Commit 6d2a6a1c by BellCodeEditor

save project

parent aa39c400
Showing with 11 additions and 4 deletions
......@@ -2,6 +2,13 @@
#a=open(r"C:\Users\EDZ\Desktop\pyt\123.txt",'w',encoding='utf-8')
#a.write('小兰,12本,小丽,11本,李文,9本,张伟,16本')
#a.close()
with open(r"C:\Users\EDZ\Desktop\pyt\123.txt",'a',encoding='utf-8')as a:
a.write('小强,12本\n')
a.write('李明,15本\n')
\ No newline at end of file
#with open(r"C:\Users\EDZ\Desktop\pyt\123.txt",'a',encoding='utf-8')as a:
#a.write('小强,12本\n')
#a.write('李明,15本\n')
with open(r"C:\Users\EDZ\Desktop\pyt\123.txt",'r',encoding='utf-8')as a:
b=a.read()
for data in b:
if '小强,10本' in b:
print('数据1在')
if '小兰,12本' in b:
print('数据2在')
\ 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