Commit 3d51eb7b by BellCodeEditor

save project

parent 17482627
Showing with 6 additions and 2 deletions
...@@ -5,7 +5,11 @@ ...@@ -5,7 +5,11 @@
# ll.close() # ll.close()
# with open(r'C:\Users\Administrator\Desktop\kk.txt','a',encoding='utf-8')as file: # with open(r'C:\Users\Administrator\Desktop\kk.txt','a',encoding='utf-8')as file:
# file.write("小兰:12本\n") # file.write("小兰:12本\n")
data_all = ""
with open(r'C:\Users\Administrator\Desktop\kk.txt','r',encoding='utf-8')as file: with open(r'C:\Users\Administrator\Desktop\kk.txt','r',encoding='utf-8')as file:
for i in file: for i in file:
if "小兰" in i: if "小兰" in i:
print("Yes") i=i.replace('23','22')
\ No newline at end of file data_all = data_all+i
with open(r'C:\Users\Administrator\Desktop\kk.txt','w',encoding='utf-8')as file:
file.write(data_all)
\ 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