title: How to run a python script on flask backend?
body: <p>I have a small flask app where it takes user input and returns some text. Here the user input is fed to another python script say temp.py and this temp.py will return a value which should be returned to user. For eg:</p>
  <h1>flask.py</h1>
  <pre><code>from flask import Flask, render_template, request
  app = Flask(__name__)
  
  @app.route('/')
  def result():
      return render_template(&quot;index.html&quot;)
  
  @app.route('/getconfig', methods=['GET', 'POST'])
  def config():
      value = request.form['config']
      print (&quot;This is the user value :  &quot;, value);
      // This value is written to a file say x.pol and my temp.py reads from x.pol file and writes the output to y.pol. I'm not sure how to trigger the script like &quot;python temp.py&quot; on the server.
      // The reason I'm doing this because I don't want to tweak the third party tool where, the third party tool reads from input files and generates output files. 
  
      return content_generated_by_temp.py // by reading y.pol.
  
  if __name__ == '__main__':
     app.run(debug = True)
  </code></pre>
  <p>By the way, temp.py is itself a nightmare. I understood what the tool does. For more info about the tool: <a href="https://github.com/google/capirca" rel="noreferrer">Google Caprica</a></p>