1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| from bottle import route, run
@route('/user/<id:int>') def getid(id=''): return "ID:%d"%id
@route('/weight/<weight:float>') def getweight(weight=''): return "weight:%f"%weight
@route('/url/<path:path>') def getpath(path=''): return path
run(port=8080,debug=True,reloader=True)
|