Commit 898bce89 by BellCodeEditor

save project

parent 89cc6209
Showing with 6 additions and 1 deletions
...@@ -5,9 +5,14 @@ ...@@ -5,9 +5,14 @@
#file.write("李文:9本\n") #file.write("李文:9本\n")
#file.write("张伟:16本\n") #file.write("张伟:16本\n")
#file.close() #file.close()
new_data=" "
with open(r"C:\Users\EDY\Desktop\10086.txt","r",encoding="utf-8") as files: with open(r"C:\Users\EDY\Desktop\10086.txt","r",encoding="utf-8") as files:
data=files.read() data=files.read()
data.rep if "小兰" in data:
data=data.replace("小兰""小坤")
new_data+=data
with open(r"C:\Users\EDY\Desktop\10086.txt","w",encoding="utf-8") as files:
files.write(new_data)
# print(a) # print(a)
# if "坤坤: 114514本" in data: # if "坤坤: 114514本" in data:
# print("该数据在里面") # print("该数据在里面")
......
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