from flask import Flask
from flask import request
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'hello world!'
@app.route('/login')
def hello_world2():
name = request.values.get("name")
pwd = request.values.get("pwd")
return f'name={name},pwd={pwd}'
@app.route('/abc')
def hello_world1():
id = request.values.get("id")
return f"""
<form action="/login">
账号:<input name="name" value="{id}"><br>
密码:<input name="pwd">
<input type="submit">
</form>
"""
if __name__ == '__main__':
app.run()
python flask 传参数
最新推荐文章于 2024-06-23 23:59:45 发布