diff --git a/main.py b/main.py index 723ee5a..3468438 100644 --- a/main.py +++ b/main.py @@ -18,6 +18,18 @@ def splitLine(fileline): retval = [] return tmpline +def lookup(ip): + net = Net(ip) + obj = IPASN(net) + results = obj.lookup() + pprint(results) + for key,value in results.iteritems(): + if key == "asn_country_code": + print(value) + if key == "asn_cidr": + print(value) + + ipListFile = openFile("iplist.txt") ipList = ipListFile.read() test = splitLine(ipList) @@ -42,13 +54,3 @@ for value in ips: #for a in ipList: # print(a) -def lookup(ip): - net = Net(ip) - obj = IPASN(net) - results = obj.lookup() - pprint(results) - for key,value in results.iteritems(): - if key == "asn_country_code": - print(value) - if key == "asn_cidr": - print(value)