文件的内容修改 # 方式1 覆盖 # with open(r'c.txt','r',encoding='utf8') as f: # data = f.read() # # print(type(data)) # with open(r'c.txt','w',encoding='utf8') as f1: # new_data = data.replace('tony','jason') # f1.write(new_data) # 方式2 新建 import os...