I have a Flask App that runs 2 shell scripts and renders an HTML template index.html.
import subprocess
from flask import Flask, request, render_template
app = Flask(__name__)
@app.route('/result', methods =["POST"])
def process_html_input():
if request.method == "POST":
git_url = request.form.get("giturl")
subprocess.call(['sh', 'installer_script1.sh'])
subprocess.call(['sh', 'installer_script2.sh'])
return render_template("index.html")
if __name__=='__main__':
app.run()
I want to print the content of the Python console as and when it appears (while the script is executing) to the same HTML template index.html -
<html lang="en">
<body>
</body>
</html>
I'm unable to write it, can someone help me with the python and HTML code ? I have tried this but unable to make it work.