37,743
社区成员




import MySQLdb
conn=MySQLdb.connect(host="localhost",user="root",passwd="password",db="db");
cur = conn.cursor()
for ip in open(r'C:\Users\Downloads\out.data').read().split('\n'):
cur.exceute("select domainname from dns where responsedata like '%%%s%%'"% ip)
rs = cur.fetchone()
print ip, 'No result' if not rs else rs[0]
import MySQLdb
conn=MySQLdb.connect(host="localhost",user="root",passwd="password",db="db");
cur = conn.cursor()
for ip in open(r'C:\Users\Downloads\out.data').read().split('\n'):
cur.exceute("select domainname from dns where responsedata like '%%%s%%'"% ip)
rs = cur.fetchone()
print ip, 'No result' if not rs else rs[0]
"select domainname from dns where responsedata like '%" + ip + "%';"