发布时间:2019-09-24 08:34:21编辑:auto阅读(2138)
在原有的文件上,修改替换,并放到新的文件里
old = open('day','r')
new = open('new_day','w')
old_replace = input('please replace content:')
new_replace = input('please new replace content:')
for i in old:
if old_replace in i:
i = i.replace(old_replace,new_replace)
new.write(i)
old.close()
new.close()
上一篇: 使用python读取sqlit3并做图
下一篇: python 3 ---字符串方法使用整
50387
49672
40284
37322
31728
28588
27522
22308
22299
20612
357°
965°
755°
714°
955°
835°
1449°
2726°
2463°
1891°