Commit 96c5ab8f by BellCodeEditor

auto save

parent 24f05792
Showing with 7 additions and 3 deletions
......@@ -4,5 +4,9 @@
# file1.write('小丽:11本\n')
# file1.write('李文:9本\n')
# file1.write('张伟:16本\n')
with open(r'C:\Users\Administrator\Desktop\test.txt','a',encoding = 'utf-8')as file:
file.write('淘气:99本\n')
\ No newline at end of file
# with open(r'C:\Users\Administrator\Desktop\test.txt','a',encoding = 'utf-8')as file:
# file.write('淘气:99本\n')
with open(r'C:\Users\Administrator\Desktop\test.txt','r',encoding = 'utf-8')as file:
for i in file:
if '小兰:12本' in i:
print('找到了')
\ 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