Commit 797848f2 by BellCodeEditor

save project

parent c0a8b7a9
Showing with 9 additions and 2 deletions
new=""
with open(r"C:\Users\6\Desktop\text.txt",'w',encoding="utf-8") as file1: with open(r"C:\Users\6\Desktop\text.txt",'w',encoding="utf-8") as file1:
file1.write("welcome to phigros!\n") file1.write("welcome to phigros!\n")
with open(r"C:\Users\6\Desktop\text.txt",'a',encoding="utf-8") as file1: with open(r"C:\Users\6\Desktop\text.txt",'a',encoding="utf-8") as file1:
file1.write("下面将进行基的玩法教学") file1.write("下面将进行基ben的玩法教学")
with open(r"C:\Users\6\Desktop\text.txt",'r',encoding="utf-8") as file1: with open(r"C:\Users\6\Desktop\text.txt",'r',encoding="utf-8") as file1:
a=file1.read() a=file1.read()
print(a) print(a)
with open(r"C:\Users\6\Desktop\text.txt",'r',encoding="utf-8") as file1:
for data in file1:
if "ben" in data:
data=data.replace("ben","本")
new += data
print(new)
\ No newline at end of file
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