I'm currently running a few python script to handle some data which I then forward to a html file via the Flask framework.
The data is collected from a specific folder in my project. I would like to add a listener that re-run my scripts if the files are changed inside the specific data folder. I think I can manage the listener but I'm really confused with how I can update the information passed to the html through the flask app.
for example:
@app.route("/")
def chart():
return render_template("chart.html",
data1=data1, someOtherData=someOtherData)
If the listener reacts, I want to update the passed information(data1, someOtherData). I have tried looking around but cant really get my head around how to make this work.