#过滤掉一个文件中的空行
with open('D:/songhuajie/efforts/Python/test/a.txt','r') as f1:
f1.seek(0)
for line in f1.readlines():
if line=='\n':
continue
with open('D:/songhuajie/efforts/Python/test/result.txt','a',encoding='utf-8') as f2:
f2.write(line)
print('write successfull!')