Commit 1a405e28 by BellCodeEditor

auto save

parent a503b90d
Showing with 4 additions and 14 deletions
# 写入同学们的捐赠明细:'小兰:12本'、'小丽:11本'、'李文:9本'、'张伟:16本' a=open(r"C:\Users\pc\Desktop\123"text.txt,"w",encoding="utf-8")
with open(r"C:\Users\pc\Desktop\123\test.txt","r",encoding="utf-8") as a: open.write(SB)
# b = a.read() open.close()
#a.write("小丽:11本\n") \ No newline at end of file
# a.read("小兰:9本\n")
# a.read("李文:16本\n")
for data in a:
if "小丽:11本" in data:
date=data.replace("小丽:11本","小丽没捐,因为她是老八和老六的合体。")
new_date+=date
with open(r"C:\Users\pc\Desktop\123\tast.txt","w",encoding="utf-8") as a:
a.write(new_data)
\ 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