Commit b554549b by BellCodeEditor

save project

parent 4a93415b
Showing with 8 additions and 6 deletions
new_date = ""
with open(r'C:\Users\连哥\Desktop\test.txt','r',encoding = 'utf-8') as file:
for date in file:
print(date)
if '小强:10本' in file:
print('在')
else:
print('不在')
\ No newline at end of file
if '小丽:11本' in date:
date=date.replace("小丽:11本","小丽:10本")
new_date += date
with open(r'C:\Users\连哥\Desktop\test.txt','w',encoding = 'utf-8') as file:
file.write(new_date)
\ 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