标签:replace lin pen for day ace close encoding yesterday
f=open(‘yesterday‘,‘r‘,encoding=‘utf-8‘)
f_new=open(‘yesterday.bak‘,‘w‘,encoding=‘utf-8‘)
for line in f:
if ‘当我小的时候‘ in line:
line=line.replace(‘当我小的时候‘,‘当zhow小的时候‘)
f_new.write(line)
f.close()
f_new.close()
标签:replace lin pen for day ace close encoding yesterday
原文地址:https://www.cnblogs.com/zhowhen/p/8972899.html