Commit 16795d92 by BellCodeEditor

save project

parent 6db6c472
Showing with 12 additions and 1 deletions
# 写入同学们的捐赠明细:'小兰:12本'、'小丽:11本'、'李文:9本'、'张伟:16本' with open(r"G:\test.txt","w",encoding="utf-8")as file:
file.write("小日子武力值:0.00001\n")
file.write("台湾武力值:0.000011\n")
new=""
with open(r"G:\test.txt","r",encoding="utf-8")as file:
for date in file:
if "台湾武力值:0.00001\n" in date:
date=date.replace("台湾武力值:0.000011\n","台湾武力值:0.00001\n")
new =new+date
with open(r"G:\test.txt","w",encoding="utf-8")as file:
file.write(new)
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