Commit 1cb5e6bf by BellCodeEditor

save project

parent 7349f2f7
Showing with 13 additions and 3 deletions
#filel=open(r'C:\\Users\\Administrator\\Desktop\\test.txt','w',encoding='utf-8')
#filel.write('小强:10本\n')
#filel.write('李明:15本\n')
with open(r'C:\\Users\\Administrator\\Desktop\\test.txt','a',encoding='utf-8')as file:
file.write('小郭:108923897347312895719847130847149470194730194719471本\n')
\ No newline at end of file
#with open(r'C:\\Users\\Administrator\\Desktop\\test.txt','a',encoding='utf-8')as file:
#file.write('小郭:108923897347312895719847130847149470194730194719471本\n')
#file1=open(r'C:\\Users\\Administrator\\Desktop\\test.txt','r',encoding='utf-8')
#a=file1.read()
#print(a)
#file1.close()
#with open(r'C:\\Users\\Administrator\\Desktop\\test.txt','r',encoding='utf-8')as file:
#a=file.read()
#print(a)
with open(r'C:\\Users\\Administrator\\Desktop\\test.txt','r',encoding='utf-8')as file:
for date in file:
if'小强:10本'in date:
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