title: How to re-run my python flask application every night?
body: <p>I have a python flask application where I cache some data in memory when app.py runs.</p>
  
  <p>There's a function call like this:</p>
  
  <pre><code>cache_data()
  </code></pre>
  
  <p>I want this function to be ran once every night. Is there a way I can schedule the script to rerun by itself or just the function to be called whenever the date of current_date has changed?</p>
  
  <pre><code>if __name__ == "__main__":
      port = 80
      os.system("open http://localhost:{0}".format(port))
  
      app.debug = True # Turn False later
      app.run(host='0.0.0.0', port=port)
  </code></pre>