Commit 1bff8fc7 by BellCodeEditor

auto save

parent 5ec53ebb
Showing with 16 additions and 0 deletions
newdate=[]
with open("C:\\Users\\hp\\Desktop\\周报\\text.txt","r",encoding="utf-8") as file:
a=file.readlines()
for i in a:
newi=i.split()
newi1=newi[1:]
newi2=0
for j in newi1:
j=int(j)
newi2+=j
date=newi[0]+":"+str(newi2)+"\n"
newdate.append(date)
print(newdate)
with open("C:\\Users\\hp\\Desktop\\周报\\text.txt","w",encoding="utf-8") as file:
file.writelines(newdate)
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