Commit db327bbd by BellCodeEditor

save project

parent 52675025
Showing with 7 additions and 5 deletions
# 写入同学们的捐赠明细:'小兰:12本'、'小丽:11本'、'''、'张伟:16本' # 写入同学们的捐赠明细:'小兰:12本'、'小丽:11本'、'''、'张伟:16本'
#b=open(r'C:\Users\Windows 7\Desktop\12.txt','a',encoding='utf-8') #b=open(r'C:\Users\Windows 7\Desktop\12.txt','a',encoding='utf-8')
#b.write('小兰:12本\n') #b.write('小兰:12本')
#b.write('小强:10本\n') #b.write('小强:10本\n')
#b.write('李强:15本\n') #b.write('李强:15本\n')
#b.close() #b.close()
with open(r'C:\Users\Windows 7\Desktop\12.txt','a',encoding='utf-8')as b: with open(r'C:\Users\Windows 7\Desktop\12.txt','r',encoding='utf-8')as b:
b.write('小丽:11本\n') #b.write('小丽:11本\n')
b.write('张伟:16本\n') #b.write('张伟:16本\n')
\ No newline at end of file a=b.read()
print(a)
\ 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