IPy过滤

#coding=utf-8

from IPy import IP

write=open('result.txt','a')

allgame=open('allgame.txt')

gameline=allgame.readline()

while gameline:  

name=gameline.split()[0].strip()  #取名字  

IP1=gameline.split()[1].strip()  #取IP  

ydzl=open('ydzl.txt')  

ydzlread=ydzl.readline()  

while ydzlread:   

if  (IP1) in IP(ydzlread.strip()):    

result='%s %s\n'%(name,IP1)    

write.writelines(result)    

print result    

break   

ydzlread=ydzl.readline()  

gameline=allgame.readline()

 

posted @ 2017-04-12 17:04  monster_ygs  阅读(316)  评论(2编辑  收藏  举报