Commit 553ec636 by BellCodeEditor

auto save

parent 980d738e
#a=open(r'C:\Users\Student-A09\Desktop\tst','a',encoding='utf-8')
##a.write('小强,18本\n')
#a.write('小明,15本\n')
#a.close()
with open(r'C:\Users\Student-A09\Desktop\tst','r',encoding='utf-8') as a:
for data in a:
if '小强,18本'in data :
print("zai")
if '小明,15本'in data :
print("zai")
\ No newline at end of file
# 写入同学们的捐赠明细:'小兰:12本'、'小丽:11本'、'李文:9本'
file1=open(r'C:\Users\Student-A09\Desktop\一级题\test.txt','w',encoding='utf-8')
file1.write('nn:12')
file1.close()
\ No newline at end of file
with open(r'C:\Users\Student-A09\Desktop\一级题\test.txt','a',encoding='utf-8')as file:
file.write('hh=jhjjk')
\ No newline at end of file
This diff is collapsed. Click to expand it.
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