Commit 6068762e by BellCodeEditor

save project

parent 929ee7dd
Showing with 8 additions and 2 deletions
...@@ -11,4 +11,11 @@ with open('C:\\Users\\windoins\\Desktop\\test.txt',"w",encoding="utf-8")as file: ...@@ -11,4 +11,11 @@ with open('C:\\Users\\windoins\\Desktop\\test.txt',"w",encoding="utf-8")as file:
# file.write('小兰:12本\n') # file.write('小兰:12本\n')
# file.close() with open('C:\\Users\\windoins\\Desktop\\test.txt',"r",encoding="utf-8")as file:
\ No newline at end of file a=file.readlines()
new_data=""
for data in a:
print(data)
if "小兰:12本" in data:
print("数据在里面")
"小兰:12本"
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