From 28a7f6acc65104eb8a3d14170ecdd56986f3b828 Mon Sep 17 00:00:00 2001 From: Benajmyn Love Date: Tue, 20 Feb 2018 08:49:30 +1100 Subject: [PATCH] Simple threading implementaion, no idea if this works yet --- main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 687cbc7..ced7eea 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,5 @@ import os +import threading from ipwhois.net import Net from ipwhois.asn import IPASN from pprint import pprint @@ -7,6 +8,9 @@ tmpips = [] #NOTE Need to reset this variable between runs ips = [] ipdict = {} +class threadedLookup(threading.Thread): + def run(self, ip): + lookup(ip) def openFile(filename): try: @@ -48,7 +52,9 @@ for x in tmpips: ips.append(y) for value in ips: if "." in value: - lookup(value) + #lookup(value) + lookupThread = threadedLookup(name = "lookup" + value) + lookupThread.start() #pprint(ipdict)