Commit 48a44449 by BellCodeEditor

save project

parent 322f8058
Showing with 17 additions and 2 deletions
......@@ -5,5 +5,15 @@
# file1.write('李文:9本\n')
# file1.write('张伟:16本\n')
# file1.close()
with open(r'C:\Users\DELL\Desktop\test.txt','a',encoding='utf_8') as file1:
file1.write('吴鹏:15本\n')
new_data=''
with open(r'C:\Users\DELL\Desktop\test.txt','r',encoding='utf_8') as file1:
for data in file1:
if '111' in data:
data=data.replace('111','222')
new_data = new_data +data
print(new_data)
with open(r'C:\Users\DELL\Desktop\test.txt','w',encoding='utf_8') as file1:
file1.write(new_data)
with open(r"C:\Users\DELL\Desktop\book.doc","w",encoding = "utf-8") as file:
with open(r"C:\Users\DELL\Desktop\book.doc","w",encoding = "utf-8") as file:
file.write("wy is a big 192")
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