一、读写修改文件
f=open("honghei","r")
#print(f.read())
f_new =open("honghei.bak","w")
for line in f:
if "甜的" in line:
line=line.replace("甜的","asdfghjkkkkkkkkkl")
f_new.write(line)
二、程序运行代码后出现Process finished with exit code 0是因为
exit code 0 表示程序执行成功,正常退出
exit code 1 表示程序执行执行过程中遇到了某些问题或者错误