雕刻时光

just do it……nothing impossible
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2021年9月8日

摘要: 有个文本文件,需要替换里面的一个词,用python来完成,我是这样写的: 1 2 3 4 5 def modify_text(): with open('test.txt', "r+") as f: read_data = f.read() f.truncate() #清空文件 f.write(re 阅读全文

posted @ 2021-09-08 17:19 huhuuu 阅读(185) 评论(0) 推荐(0) 编辑