如何使用html在运行视频的同时运行python脚本?

如何使用html在运行视频的同时运行python脚本?,python,html,flask,Python,Html,Flask,我正在尝试自动播放视频,同时在后台运行一个python脚本,用于侦听用户输入并存储它。我该怎么做?这是我的html: <section id="therapist"> <div class="container" id="therapist_container"> <h1 class="jumbotron text-center" id="chatbot_title

我正在尝试自动播放视频,同时在后台运行一个python脚本,用于侦听用户输入并存储它。我该怎么做?这是我的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>

治疗专家
这是我的main.py文件:

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')
从烧瓶导入渲染模板,烧瓶,请求
app=烧瓶(名称)
@附件路线(“/”)
def home():
返回渲染模板(“index.html”)
@app.route(“/get”,methods=[“get”])
def t_care():
user=request.args.get('user')
location=request.args.get('location')
@app.route(“/”,methods=[“POST”])
def用户_选项():
返回渲染模板(“list.html”)
如果名称=“\uuuuu main\uuuuuuuu”:
app.run(host='0.0.0.0')