Python,文件修改
2021-06-20 17:04
阅读:314
标签:python 修改 replace open coding pytho span auth ace Python,文件修改 标签:python 修改 replace open coding pytho span auth ace 原文地址:https://www.cnblogs.com/hjdshizhidong/p/9688098.html__author__ = ‘12711‘
#-*- coding:utf-8 -*-
f=open("F",‘r‘)
f_n=open("N",‘w‘)
for i in f:
if "我爱你" in i :
i=i.replace("我爱你","我恨你")
f_n.write(i)
f.close()
f_n.close()
下一篇:Java测试总结(ATM)
评论
亲,登录后才可以留言!