标签:
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() delblankline("output.py","output1.py")
标签:
原文地址:http://www.cnblogs.com/billyzh/p/5851429.html