title: Flask Dash passing a variable generated in a callback to another callback
body: <p>In a callback, a dataframe is created from user inputs. I need to use that dataframe in another function, in order to serve it to the user.
  I read that server.route can do this, with Flask SendFile, but I can't access the dataframe since I cannot use global variables.</p>
  
  <p>I have read there is a hidden div method but I don't know how I can access a html div property from inside of python.</p>
  
  <p>'''</p>
  
  <pre><code>server = flask.Flask('app')
  
  app = dash.Dash(__name__,
  external_stylesheets=external_css,
  server=server)
  
  master = pd.read_csv('master_dataframe.csv')
  
  @server.route("/downloadable/")
  
  def download_file():
  
      df = # The dataframe I need that is in the other function
      buffer = io.BytesIO()
      dff.to_excel(buffer)  # write to BytesIO buffer
      buffer.seek(0)
      return send_file(
          buffer,
          attachment_filename='data.xlsx',
          as_attachment=True,
          cache_timeout=0
      )
  @app.callback(
      Output('plot_button','n_clicks_timestamp'),
      [Input('account_selector','value')]
  )
  def generate_layout(value):
      df = make_something(master, value)
      return html_layout
  </code></pre>
  
  <p>'''</p>