How do I run a python script at the same time as my video with html?

Viewed 79

I am trying to play a video automatically and have a python script run at the same time in the background that listens to the user inputs and stores it. How do I do that? Here's my html:

<section id="therapist">
  <div class="container" id="therapist_container">
    <h1 class="jumbotron text-center" id="chatbot_title">Therapist</h1>
    <div class="row" id="therapist_row">
      <div class="col-sm-6 offset-sm-3">
          <div id="vid">
            <video width="320" height="240" autoplay>
              <source src="movie.mp4" type="video/mp4">
              <source src="movie.ogg" type="video/ogg">
              <script type="python" src="speech_recog.py">
                  
              </script>
            </video>
          </div>
      </div>
    </div>

</div>
</section>

and here's my main.py file:

from flask import render_template, Flask, request


app = Flask(__name__)

@app.route("/")
def home():    
    return render_template("index.html")

@app.route("/get", methods=["GET"])
def t_care():
    user = request.args.get('user')
    location = request.args.get('location')

@app.route("/<user>", methods=["POST"])
def user_options():
    return render_template("list.html")

if __name__ == "__main__":    
    app.run(host='0.0.0.0')
0 Answers
Related