批量将文本中的“??”乱码替换成“e”,改好后的文本保存在新的文件中
with open('oldfile', 'r') as oldfile:
with open('newfile', 'w') as newfile2:
for i in oldfile:
if "??" in i:
newfile2.write(i.replace("??", "e"))
else:
newfile2.write(i)