你的数据超过了256列,用xlwt肯定不行,可以用openyxl来代替,或者改为存储为csv格式: demo from openpyxl import Workbook wb = Workbook() # grab the active worksheet ws = wb.active # Data can be assigned directly to cells ws['A1'] = 42 # Rows can also be appended ws.append([1, 2, 3]) # Python types will automatically be converted import datetime ws['A2'] = datetime.datetime.now() # Save the file wb.save('sample.xlsx')
|