Commit 3e9f6b33 by BellCodeEditor

auto save

parent 654f7069
Showing with 11 additions and 0 deletions
with open('c:\\Users\\Administrator\\Desktop\\100.txt',"a",encoding='utf-8') as f:
f.write('小强:10本\n')
f.write('李明:15本\n')
\ No newline at end of file
with open('c:\\Users\\Administrator\\Desktop\\100.txt',"r",encoding='utf-8') as f:
for i in f:
if '小强:10本' in i:
print("数据在里面")
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