Commit 7ff5e1ec by BellCodeEditor

auto save

parent 3b59c8ea
Showing with 25 additions and 2 deletions
with open(r"C:\Users\Windows\Desktop\test.txt",'a',encoding='utf_8')as file1: #file1=open(r"C:\Users\Windows\Desktop\test.txt",'a',encoding='utf_8')
file1.write('张凌:16本\n') #file1.write('张凌:16本\n')
#file1.close()
#with open(r"C:\Users\Windows\Desktop\test.txt",'a',encoding='utf_8')as file1:
# file1.write('张凌:16本\n')
#file1=open(r"C:\Users\Windows\Desktop\test.txt",'r',encoding='utf_8')
#aa=file1.read()
#print(aa)
with open(r"C:\Users\Windows\Desktop\test.txt",'r',encoding='utf_8')as file1:
aa=file1.read()
print(aa)
\ No newline at end of file
with open(r"C:\Users\Windows\Desktop\test.txt",'r',encoding='utf_8')as file1:
for i in file1:
print(i)
if '小兰:12本\n' in filel:
print('存在')
else:
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