xlwt write excel sheet on the fly

前端 未结 3 1047
太阳男子
太阳男子 2021-01-17 11:07

I am used to creating a spreadsheet in the following way:

    wbk = xlwt.Workbook()
    earnings_tab = wbk.add_sheet(\'EARNINGS\')
    wbk.save(filepath)
         


        
3条回答
  •  自闭症患者
    2021-01-17 11:36

    this is what i use in Django:

    response = HttpResponse(content_type='application/vnd.ms-excel')
    response['Content-Disposition'] = 'attachment; filename=file.xls'
    book.save(response)
    return response
    

提交回复
热议问题