Commit 79df07dd by BellCodeEditor

save project

parent a828519c
Showing with 13 additions and 0 deletions
......@@ -7,6 +7,19 @@ filel.write("张伟:16本\n")
filel.write("小强:10本\n")
filel.write("李明:15本\n")
'''
'''
with open(r"C:\\Users\\Administrator\\Desktop\\test.txt","a",encoding="utf-8") as file:
#filel.write("小兰:12本\n")
file.write("小郭:-100本")
filel=open(r"C:\\Users\\Administrator\\Desktop\\test.txt","r",encoding="utf-8")
a=filel.read()
print(a)
filel.close()
with open(r"C:\\Users\\Administrator\\Desktop\\test.txt","r",encoding="utf-8") as file:
a=file.read()
print(a)
'''
with open(r"C:\\Users\\Administrator\\Desktop\\test.txt","r",encoding="utf-8") as file:
for date in file:
if"小强:10本"in date:
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