Hi,
I have python code which will write an excel file based on two input files to my project directory location. When I execute the code through a link in web app, the file created does not reflect/overwrite until I manually reload the web app. Is there any solution for this ?
cal_operations.py:
# write dataframe to Excel file
df = pd.DataFrame(dict([(k, pd.Series(v)) for k, v in cal_df.items()]))
df.to_excel("/home/asinha01/autocal/output/CALENDAR.xlsx", index=False)
main.py:
@app.route("/downloadxls", methods=['GET'])
def get_cal_xl():
exec('cal_operations')
return send_file(
'/home/asinha01/autocal/output/CALENDAR.xlsx',
mimetype="xlsx",
as_attachment=True)