测试 flask 修改启动后修改代码自动生效
from flask import Flask
app = Flask(__name__)
app.debug = True
@app.route("/")
def he():
return "hilo2u"
if __name__ == "__main__":
app.run()
flask 接收参数常规操作
// post 表单提交 --------------------------------start
aa:1234
bb:5678
CC:789
// 接收
re = request.form
# ImmutableMultiDict([('aa', '1234'), ('bb', '5678'), ('CC', '789')])
re = request.form.get("aa")
# 1234
re = request.values.get("bb") // post, get
# 5678
re = request.args.get("bb") // 该接收方式 ,适用于get
# None
// post 表单提交 ---------------------------------- end