Commit 4f2ce2ad by BellCodeEditor

save project

parent 815a1386
Showing with 7 additions and 4 deletions
# file=open(r"D:\abc.txt","w",encoding="utf-8")
# file.write('小兰:12本n/')
# file.write('小兰:12本\n')
# file.close()
with open(r"D:\abc.txt","a",encoding="utf-8") as file:
file.write('小强:12本n/')
#with open(r"D:\abc.txt","a",encoding="utf-8") as file:
# file.write('小强:10本\n')
with open(r"D:\abc.txt","r",encoding="utf-8") as file:
for data in file:
if "小强:10本" in data:
print('数据在其中')
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