title: Python flask-app eventhandler
body: <p>I'm currently running a few python script to handle some data which I then forward to a html file via the Flask framework. </p>
  
  <p>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. </p>
  
  <p>for example: </p>
  
  <pre><code>@app.route("/")
  def chart():
      return render_template("chart.html",
      data1=data1, someOtherData=someOtherData)
  </code></pre>
  
  <p>If the listener reacts, I want to update the passed information(<code>data1</code>, <code>someOtherData</code>). I have tried looking around but cant really get my head around how to make this work.</p>