Commit f3d33f66 by BellCodeEditor

auto save

parent efa2ba92
Showing with 5 additions and 4 deletions
......@@ -4,6 +4,7 @@ filel.write('小美:12本\n')
filel.write('小丽:11本\n')
filel.write('李文:9本\n')
filel.close()
with open(r'C:\\Users\\Public\\Desktop\\test.txt',"r",encoding='utf-8')asfile1:
a=filel.read()
print(a)
\ No newline at end of file
with open(r'C:\\Users\\Public\\Desktop\\test.txt','r',encoding='utf-8')as file1:
for data in filel:
if'小丽:11本'in data:
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