发布网友 发布时间:2022-04-28 15:49
共1个回答
热心网友 时间:2022-06-19 13:10
#my_list = [[1, 2, 3, 4, 5], ['a', 'b', 'c', 'd', 'e']]
def wirte_xls(my_list):
import xlwt
wbk = xlwt.Workbook()
sheet = wbk.add_sheet("test")
i = 0
for netted in my_list:
for x, item in enumerate(netted):
sheet.write(i, x, item)
i += 1
wbk.save('test.xls')
缩进不知道怎么调试,给你截个图吧