1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| from bottle import route,run,request
htmlst = """ <!DOCTYPE html> <html> <head> <meta charset='utf-8'> <title><h2>你好</h2></title> <h2>你好</h2> </head> <body> <form action="/info" method='GET'> <a href="http://localhost/info?id=437221368&email=437221368@qq.com">提交GET信息</a> </form > </body> </html> """
@route('/') def index(): return htmlst
@route('/info',method='GET')#默认也是GET def gepinfo(): id = request.query.id email = request.query.email return (id,email)
run(port=8088,debug=True,reloader=True)
|