Simple threading implementaion, no idea if this works yet

This commit is contained in:
benjamyn committed 2018-02-20 08:49:30 +11:00
1 parent 5ce4880ad4
commit 28a7f6acc6
1 file changed
+7 -1
+7 -1
View File
@@ -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)