Commit 488c8888 by BellCodeEditor

save project

parent cb9f22e7
Showing with 4 additions and 3 deletions
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#"C:\Users\Student\Desktop\book.txt" #"C:\Users\Student\Desktop\book.txt"
#filel=open(r'C:\Users\Student\Desktop\test.txt','w',encoding='utf-8') #filel=open(r'C:\Users\Student\Desktop\test.txt','w',encoding='utf-8')
#filel.write("'小兰:12本'、'小丽:11本'、'李文:9本'、'张伟:16本'、,'w',encoding='utf-8'") #filel.write("'小兰:12本'、'小丽:11本'、'李文:9本'、'张伟:16本'、,'w',encoding='utf-8'")
with open(r'C:\Users\Student\Desktop\test.txt','a',encoding='utf-8') as file: with open(r'C:\Users\Student\Desktop\test.txt','r',encoding='utf-8') as file:
for data in file:
file.write("'小强:12本'、'李明:11本'") if '小强:10本' in data:
print('数据在文件中')
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