Commit 68c6faae by BellCodeEditor

save project

parent 0e667cb1
Showing with 6 additions and 3 deletions
...@@ -4,5 +4,8 @@ file.close() ...@@ -4,5 +4,8 @@ file.close()
file1=open(r"C:\Users\user\Desktop\nm.txt",'r',encoding='utf-8') file1=open(r"C:\Users\user\Desktop\nm.txt",'r',encoding='utf-8')
a=file1.read() a=file1.read()
print(a)
file1.close() with open(r"C:\Users\user\Desktop\nm.txt",'r',encoding='utf-8')as file:
\ No newline at end of file for data in file:
if'你好'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