Sending data from HTML form to a Python script in Flask

后端 未结 2 875
一个人的身影
一个人的身影 2020-11-22 03:18

I have the code below in my Python script:

def cmd_wui(argv, path_to_tx):
    \"\"\"Run a web UI.\"\"\"
    from flask import Flask, flash, jsonify, render_t         


        
2条回答
  •  失恋的感觉
    2020-11-22 03:26

    You need a Flask view that will receive POST data and an HTML form that will send it.

    from flask import request
    
    @app.route('/addRegion', methods=['POST'])
    def addRegion():
        ...
        return (request.form['projectFilePath'])
    
    Project file path:

提交回复
热议问题