Commit 40ee3690 by BellCodeEditor

save project

parent 016bd8b2
Showing with 3 additions and 0 deletions
......@@ -2,10 +2,13 @@
#file=open(r"C:\Users\cc\Desktop\hongbao.txt","a",encoding="utf-8")
#file.write("小强:\n")
#file.write("稿贺:\n")
s=""
with open(r"C:\Users\cc\Desktop\hongbao.txt","r",encoding="utf-8")as file:
for i in file:
#print(i)
if "苹果派" in i:
a=i.replace("苹果派","香蕉派")
print(a)
with open(r"C:\Users\cc\Desktop\hongbao.txt","w",encoding="utf-8")as file:
file.write(s)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment