# coding = utf-8
def clearBlankLine(path):
file1 = open(path, 'r', encoding='utf-8') # 要去掉空行的文件
yuan_list=file1.readlines()
file1.close()
file2 = open(path, 'w', encoding='utf-8') # 生成没有空行的文件
try:
for line in yuan_list:
if line == '\n':
line = line.strip("\n")
file2.write(line)
finally:
file2.close()
if __name__ == '__main__':
clearBlankLine()