This commit is contained in:
Benjamyn 2018-02-04 19:35:15 -05:00
parent 6fca113ea3
commit 873283e72d

22
main.py
View File

@ -19,16 +19,18 @@ def splitLine(fileline):
return tmpline return tmpline
def lookup(ip): def lookup(ip):
net = Net(ip) try:
obj = IPASN(net) net = Net(ip)
results = obj.lookup() obj = IPASN(net)
pprint(results) results = obj.lookup()
for key,value in results.iteritems(): pprint(results)
if key == "asn_country_code": for key,value in results.iteritems():
print(value) if key == "asn_country_code":
if key == "asn_cidr": print(value)
print(value) if key == "asn_cidr":
print(value)
except Exception as e:
print(e)
ipListFile = openFile("iplist.txt") ipListFile = openFile("iplist.txt")
ipList = ipListFile.read() ipList = ipListFile.read()