Commit f3d33f66 by BellCodeEditor

auto save

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