把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)
posted @ 2020-04-03 09:46  晨光曦微  阅读(203)  评论(0编辑  收藏  举报