Commit 51756559 by BellCodeEditor

auto save

parent 5ec53ebb
Showing with 15 additions and 0 deletions
with open(r'c:\Users\Admin\Desktop\sales_list.txt','r',encoding='utf_8') as rtw:
a=rtw.readlines()
B=[]
for i in a:
ii=i.split()
s=0
for x in ii[1:]:
s=s+int(x)
r=ii[0]+str(s)+"\n"
B.append(r)
with open(r'c:\Users\Admin\Desktop\新建文本文档 (2).txt','a',encoding='utf_8') as rtw:
rtw.writelines(B)
\ 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