Commit 348cafda by BellCodeEditor

save project

parent bad2a388
Showing with 6 additions and 1 deletions
...@@ -8,9 +8,14 @@ ...@@ -8,9 +8,14 @@
with open(r"C:\Users\windoins\Desktop\123.txt","r",encoding="utf-8")as file: with open(r"C:\Users\windoins\Desktop\123.txt","r",encoding="utf-8")as file:
a=file.readlines() a=file.readlines()
new_data=""
for data in a: for data in a:
print(data,end="") print(data,end="")
if "小兰:12本" in data: if "小兰:12本" in data:
print("数据在") print("数据在")
data=data.replace("小兰:12","小兰:10")
new_data=new_data+data
print(new_data)
with open(r"C:\Users\windoins\Desktop\123.txt","w",encoding="utf-8")as file:
file.write(new_data)
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