用AI赚第一桶💰低成本搭建一套AI赚钱工具,源码可二开。 广告
我们很多时候获取URL的某部分内容,而bottle在这方面能提供方便的函数给我们使用。(又是非常强悍的request对象) 下面给出代码和测试结果 ~~~ # coding:UTF-8 from bottle import Bottle, request app = Bottle() @app.get('/abc/123') def index(): return `这个地方替换成测试的变量` app.run(host="127.0.0.1", port=8000, reloader=True, debug=True) ~~~ 测试网址: http://127.0.0.1:8000/abc/123?type=qwe&action=debug#zxc | 变量名 | 输出结果 | | -- | -- | | request.fullpath | /abc/123 | | request.query_string | type=qwe&action=debug | | request.path | /abc/123 |