def delEmptLine(path = "D:\\1931031.txt",Target_path = ''):
'''
删除 两行及以上的空行
'''
if Target_path == '':
Target_path = path + 'new.txt'
line_num=1
s =''
up_line_isKong = False
with open(path, 'r',buffering= 1073741824, encoding='utf-8') as f:
for line in f:
curr_line_isKong = stri = line.strip() == '' or line == '\n'
if up_line_isKong and curr_line_isKong:
pass
else:
with open(Target_path, 'a+',buffering= 1073741824, encoding='utf-8') as wf:
wf.write(line)
up_line_isKong = curr_line_isKong and line_num > 1
line_num +=1