Commit 5c5cffda by BellCodeEditor

auto save

parent ff8108c6
Showing with 10 additions and 4 deletions
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
#fill1=open(r'C:\Users\maku\Desktop\book.txt','w',encoding='utf-8') #fill1=open(r'C:\Users\maku\Desktop\book.txt','w',encoding='utf-8')
#fill1.write('小兰:12本''小丽:11本''李文:9本''张伟:16本') #fill1.write('小兰:12本''小丽:11本''李文:9本''张伟:16本')
#fill1.close() #fill1.close()
with open(r'C:\Users\maku\Desktop\book.txt','a',encoding='utf-8') as fill1: with open(r'C:\Users\maku\Desktop\book.txt','r',encoding='utf-8') as fill1:
fill1.write('小强:1本\n') #fill1.write('小强:1本\n')
fill1.write('李明:2本\n') #fill1.write('李明:2本\n')
\ No newline at end of file #a=.read()
#print(a)
for i in fill1:
if '小强:1本' 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