Commit 1b76909a by BellCodeEditor

save project

parent 599eef18
Showing with 14 additions and 2 deletions
with open with open(r"C:\Users\Administrator\Desktop\yuanshen.txt","w",encoding="utf-8") as file1:
\ No newline at end of file file1.write("队长\n")
file1.write("博士\n")
file1.write("少女\n")
file1.write("仆人\n")
new_data=""
with open(r"C:\Users\Administrator\Desktop\yuanshen.txt","r",encoding="utf-8") as file1:
for data in file1:
if "博士" in data:
data=data.replace("博士","三月男神")
new_data+=data
with open(r"C:\Users\Administrator\Desktop\yuanshen.txt","w",encoding="utf-8") as file1:
file1.write(new_data)
\ 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