, , , , , ,SS = ''
, , , ,old_List.append(item)
, , , ,continue
, ,if FlagQ:
, , , ,SS = SS[:-1] + item
, , , ,FlagQ = item[-1] == '@'
, ,else:
, , , ,if SS != '':
, , , , , ,old_List.append(SS)
, , , , , ,SS = ''
, , , ,if item[-1] == '@': # последний символ строки
, , , , , ,FlagQ = True
, , , , , ,SS = item
, , , ,else:
, , , , , ,old_List.append(item)
if SS != '':
, ,old_List.append(SS)
#--------------------------------------
fn2="3_x.txt"
new_file=open(fn2,'w')
for i in old_List:
, , new_file.write(i+'\n')
new_file.close()
print('Done')
perenos.py
|#!/bin/env python