python读取txt每一行并替换固定字符
lines = open('pp2.txt').readlines()
fp = open('pp2.txt','w')
for s in lines:
fp.write( s.replace('\n',''))
fp.close()
lines = open('pp2.txt').readlines()
fp = open('pp2.txt','w')
for s in lines:
fp.write( s.replace('\n',''))
fp.close()