So I\'ve been using XLSXWriter in the past to export an excel file containing one tab filled with two pandas dataframes. In the past I\'ve only been exporting the file to a loca
you can use something similar to this:
from flask import Flask, send_file
import io
myio = io.StringIO()
with open(xlsx_path, 'rb') as f:
data = f.read()
myio.write(data)
myio.seek(0)
app = Flask(__name__)
@app.route('/')
def index():
send_file(myio,
attachment_filename="test.xlsx",
as_attachment=True)
app.run(debug=True)
you may also want to write your excel file using tempfile