Commit 8da6fef4 by BellCodeEditor

save project

parent df57d7c5
Showing with 7 additions and 3 deletions
......@@ -9,6 +9,9 @@ with open(r"C:\Users\Administrator\Desktop\mingxi.txt","a",encoding="utf-8")as s
with open(r"C:\Users\Administrator\Desktop\mingxi.txt","r",encoding="utf-8")as sb:
for data in sb:
if "傻逼:25本" in data :
print("数据在文件中")
data=data.replace("傻逼:25本","傻逼:255375456本")
new_data+=data
with open(r"C:\Users\Administrator\Desktop\mingxi.txt","w",encoding="utf-8")as sb:
sb.write(new_data)
with open(r"C:\Users\Administrator\Desktop\mingxi.txt","r",encoding="utf-8")as sb:
print(sb.read())
\ 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