import threading
from ipwhois import IPWhois
iplist1=open("iplist1.txt","r")
iplistlines1=iplist1.readlines()
iplist2=open("iplist2.txt","r")
iplistlines2=iplist2.readlines()
def list1():
for ip1 in iplistlines1:
ip1=ip1.strip()
try:
domaindetails=IPWhois(ip1)
fulldetails=domaindetails.lookup_whois()
org=fulldetails.get('asn_description')
org=str(org)
print(ip1+" "+org)
except:
print("Error Getting details of "+ip1)
def list2():
for ip2 in iplistlines2:
ip2=ip2.strip()
try:
domaindetails=IPWhois(ip2)
fulldetails=domaindetails.lookup_whois()
org=fulldetails.get('asn_description')
org=str(org)
print(ip2+" "+org)
except:
print("Error Getting details of "+ip2)
t1 = threading.Thread(target=list1)
t2 = threading.Thread(target=list2)
t1.start()
t2.start()