Commit 67e10005 by BellCodeEditor

save project

parent e636dcb7
Showing with 11 additions and 2 deletions
with open(r"C:\Users\MY-PC\Desktop\book","r",)
\ No newline at end of file
new_data=""
with open(r"C:\Users\MY-PC\Desktop\book1","r",encoding="utf-8") as data:
for i in data:
if "张伟:16本" in i:
print("F")
i=i.replace("张伟:16本","张伟:20本")
new_data+=i
print(new_data)
with open(r"C:\Users\MY-PC\Desktop\book1","w",encoding="utf-8") as data:
data.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