Commit 6c8e1141 by BellCodeEditor

save project

parent 82b662c6
Showing with 17 additions and 2 deletions
......@@ -6,8 +6,23 @@
#ay.close()
with open(r'C:\Users\Administrator\Desktop\book.txt','r',encoding='uft-8')as file1:
for data in file1:
if data in file1:
if'小强:10本'in data:
print('数据在文件中')
\ No newline at end of file
prin(j)
new_data=''
with open(r'C:\Users\Administrator\Desktop\book.txt','r',encoding='uft-8')as file1:
for data in file1:
if'小强:10本'in data:
data=data.replace('小强:10''小强:11')
new_data+=data
with open(r'C:\Users\Administrator\Desktop\book.txt','r',encoding='uft-8')as file1:
if file1=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