Skip to content

Commit

Permalink
🐛 Fix: Delete SUM Formula
Browse files Browse the repository at this point in the history
  • Loading branch information
boxie123 committed Jan 25, 2023
1 parent 9b3ec2e commit 323ea4b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions getGift.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,13 @@ def xlsWrite(self, gift_result, id_index):
sheet_num.write(row, column, gift_result[uid][gift_id]["gift_num"])
row += 1

column = len(sheet_header_list)
column_char = chr(column + 64)
sheet.write(0, column, "SUM")
for i in range(1, row):
formula = "SUM(C{row}:{char}{row})".format(row=i + 1, char=column_char)
sheet.write(i, column, xlwt.Formula(formula))
# 删除求和公式
# column = len(sheet_header_list)
# column_char = chr(column + 64)
# sheet.write(0, column, "SUM")
# for i in range(1, row):
# formula = "SUM(C{row}:{char}{row})".format(row=i + 1, char=column_char)
# sheet.write(i, column, xlwt.Formula(formula))

wb.save(self.name + ".xls")
print('"{}.xls" 已生成!'.format(self.name))
Expand Down

0 comments on commit 323ea4b

Please sign in to comment.