Moved function over

This commit is contained in:
Benjamyn Love 2018-02-05 10:01:18 +11:00
parent 40c3fa5c9d
commit 6fca113ea3

22
main.py
View File

@ -18,6 +18,18 @@ def splitLine(fileline):
retval = [] retval = []
return tmpline 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") ipListFile = openFile("iplist.txt")
ipList = ipListFile.read() ipList = ipListFile.read()
test = splitLine(ipList) test = splitLine(ipList)
@ -42,13 +54,3 @@ for value in ips:
#for a in ipList: #for a in ipList:
# print(a) # 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)