title: How to call a python script in backend in flask
body: <p>I'm trying to call a complicated python script in a flask app, but not entirely sure on how to do it right now. If it was simple I would just copy and paste the script with a router in flask, but that would get too messy. So far I have this for my main.py. I want to call a script temp.py.</p>
  
  <pre><code>from flask import Flask, render_template, request
  app = Flask(__name__)
  
  @app.route('/')
  def base():
      return render_template("base.html")
  
  
  @app.route('/temp', methods=['GET', 'POST'])
  def temp():
  
  
  if __name__ == "__main__":
      app.run(debug=True)
  </code></pre>