title: Send with multiple CSVs using Flask?
body: <p>I have an app that takes in some information, performs some calculations using pandas, and turns the final pandas data frame into a CSV that is then downloaded using the Flask app. How do I download multiple CSVs within one view? It seems that I can only return a single response at a time.</p>
  <p>An example snippet:</p>
  <pre><code>def serve_csv(dataframe,filename):
      buffer = StringIO.StringIO()
      dataframe.to_csv(buffer, encoding='utf-8', index=False)
      buffer.seek(0)
      return send_file(buffer,
               attachment_filename=filename,
               mimetype='text/csv')
  
  def make_calculation(arg1, arg2):
     '''Does some calculations.
     input: arg1 - string, arg2- string
     returns: a pandas data frame'''
  
  @app.route('test_app', methods=['GET', 'POST'])
  def test_app():
      form = Form1()
      if form.validate_on_submit():
      calculated_dataframe = make_calculation(str(form.input_1.data), str(form.input_2.data))
          return serve_csv(calculated_dataframe, 'Your_final_output.csv')
      return render_template('test_app.html', form=form)
  </code></pre>
  <p>So let's say in that example above that <code>make_calculation</code> returned two pandas data frames. How would I print both of them to a CSV?</p>