交换文件的产生可能有几种情况: 1,当你用vim编辑一个文件时,发生突发事件,导致窗口关闭,或者系统崩溃重启: 2,另一个vim正在编辑该文件: 下面具体说下第一种情况: 原文件: # cat a.txt This is a test for vim. line 1 line 2 line 3 在文件里面添加了新的内容: This is a test for vim. line 1 line 2 line 3 ### Add new lines: Line 4 Line 5 Line 6 还没
def delblankline(infile,outfile): infopen = open(infile,'r') outfopen = open(outfile,'w') lines = infopen.readlines() for line in lines: if line.split(): outfopen.writelines(line) else: outfopen.writelines("") infopen.close() outfopen.close() de