Commit ef407cbc by BellCodeEditor

save project

parent 3eb9fc2d
Showing with 2 additions and 8 deletions
......@@ -10,14 +10,8 @@ with open(r"C:\Users\周子轩\Desktop\test.txt","r",encoding="utf-8") as file:
a=file.read()
for i in a:
if i=="小强:15本":
#print("数据在文件中")
# if i=="小兰:12本":
# print("数据在文件中")
# new_date=replace
# for i in a:
# if i=="小强:20本":
i.replace("小强:20本","小强:15本")
new_date+=i
with open(r"C:\Users\周子轩\Desktop\test.txt","w",encoding="utf-8") as filel:
file.write(new_date)
with open(r"C:\Users\周子轩\Desktop\test.txt","w",encoding="utf-8") as file1:
file1.write(new_date)
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