flask url传参

2019-07-07 15:17:18 浏览数 (1)

from flask import Flask

app = Flask(name)

@app.route('/') def hello_world(): return 'Hello World!'

@app.route('/usr/<name>',methods=['get'])

@app.route('/user/<name>') def user(name): print(name) return name

if name == 'main': app.run()

0 人点赞