Python 2.7 下载客户端的excel文件(flask-python)

Python 2.7 下载客户端的excel文件(flask-python),python-2.7,Python 2.7,我已经创建了一个API,用于创建excel文件并为用户下载。我需要将该文件发送给用户。但是它会被下载到我的本地服务器(pc)。 这是我的密码 wb=Workbook() style_string = "font: bold on; borders: bottom dashed" style = xlwt.easyxf(style_string) sheet1=wb.add_sheet('sheet1',cell_overwrite_ok=True)

我已经创建了一个API,用于创建excel文件并为用户下载。我需要将该文件发送给用户。但是它会被下载到我的本地服务器(pc)。 这是我的密码

wb=Workbook()
style_string = "font: bold on; borders: bottom dashed"
style = xlwt.easyxf(style_string)                
sheet1=wb.add_sheet('sheet1',cell_overwrite_ok=True)                
sheet1.write(0,0,"token",style=style)                
sheet1.write(0,1,"translation",style=style)                
j = 0       
i = 1
for e in list(stoknwords):
  sheet1.write(i,j,e)
  i = i + 1
m = wb.save('xlwt.xls')
return HttpResponse(json.dumps(m), content_type='application/json')

#out.seek(0)
#return send_file(out, mimetype='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',attachment_filename='xxl.xlsx', as_attachment=True)

#return send_file(attachment_filename="file1",as_attachment=True)               `enter code here`return json.dumps(list(stoknwords))
我尝试了许多返回方法将文件发送到客户端。我是新生,请帮帮我。。