Abra un script de Python en Flask de clic

@app.route('/run-script')
def run_script():
   result = subprocess.check_output("python main.py", shell=True)
   return render_template('results.html', **locals())
Lunatic Python