Commit 273b72aa by BellCodeEditor

save project

parent a9713ff8
Showing with 8 additions and 6 deletions
...@@ -7,9 +7,11 @@ ...@@ -7,9 +7,11 @@
# qaz.write('张伟:16本\n') # qaz.write('张伟:16本\n')
# qaz.close() # qaz.close()
with open(r'C:\Users\Bellcode\Desktop\新建文本文档.txt','a',encoding="utf-8") as file: new_data=" "
file.write("鼎折覆餗:353676本\n")
with open(r'C:\Users\Bellcode\Desktop\新建文本文档.txt','r',encoding="utf-8") as file: with open(r'C:\Users\Bellcode\Desktop\新建文本文档.txt','r',encoding="utf-8") as file:
for date in file: for data in file:
if '鼎折覆餗' in date: if '鼎折覆餗' in data:
print("数据在文件中") data=data.replace("鼎折覆餗","发箍的")
\ No newline at end of file new_data+=data
with open(r'C:\Users\Bellcode\Desktop\新建文本文档.txt','w',encoding="utf-8") as file:
file.write(new_data)
\ 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