Simple threading implementaion, no idea if this works yet
This commit is contained in:
parent
5ce4880ad4
commit
28a7f6acc6
8
main.py
8
main.py
@ -1,4 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
import threading
|
||||||
from ipwhois.net import Net
|
from ipwhois.net import Net
|
||||||
from ipwhois.asn import IPASN
|
from ipwhois.asn import IPASN
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
@ -7,6 +8,9 @@ tmpips = [] #NOTE Need to reset this variable between runs
|
|||||||
ips = []
|
ips = []
|
||||||
ipdict = {}
|
ipdict = {}
|
||||||
|
|
||||||
|
class threadedLookup(threading.Thread):
|
||||||
|
def run(self, ip):
|
||||||
|
lookup(ip)
|
||||||
|
|
||||||
def openFile(filename):
|
def openFile(filename):
|
||||||
try:
|
try:
|
||||||
@ -48,7 +52,9 @@ for x in tmpips:
|
|||||||
ips.append(y)
|
ips.append(y)
|
||||||
for value in ips:
|
for value in ips:
|
||||||
if "." in value:
|
if "." in value:
|
||||||
lookup(value)
|
#lookup(value)
|
||||||
|
lookupThread = threadedLookup(name = "lookup" + value)
|
||||||
|
lookupThread.start()
|
||||||
|
|
||||||
#pprint(ipdict)
|
#pprint(ipdict)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user