Commit 01feaf0f by BellCodeEditor

save project

parent 653b1b77
Showing with 6 additions and 2 deletions
......@@ -5,6 +5,9 @@
#file1.write('张伟:1本\n')
#file1.close()
with open(r'C:\Users\ASUS\Desktop\test.txt','a',encoding='utf-8') as
with open(r'C:\Users\ASUS\Desktop\test.txt','r',encoding='utf-8') as
file1:
file1.write('小明:1本\n')
for data in file1:
if '小强:10本' in data:
data=data.replace('小强:10本''小强:11本')
print(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