Commit 83dd0f1e by BellCodeEditor

save project

parent 7a8cfa4d
Showing with 13 additions and 0 deletions
file1=open(r"C:\Users\Administrator\Desktop\diy1.txt","r",encoding='utf-8')
a=[file1.read()]
for i in a:
if '小强' in i:
print('在文件中')
file1.close()
with open(r"C:\Users\Administrator\Desktop\diy1.txt",'r',encoding='utf-8') as file1:
a=[file1.read()]
for i in a:
if '小强' 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