把1.txt每一行进行对比,长度大于8则写到2.txt里
filename=r'E:\a\wifi\dict\jikefeng.txt'
file1=r'E:\a\wifi\1.txt'
file2=r'E:\a\wifi\2.txt'
# 把1.txt每一行进行对比,长度大于8则写到2.txt里
with open(filename,'r') as f1:
with open(file2,'w') as f2:
for l1 in f1:
if len(l1)>8 :
f2.write(l1)
print(l1)