使用装饰器配置路由的
生活随笔
收集整理的這篇文章主要介紹了
使用装饰器配置路由的
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?
上面的 “Hello World” 修改如下:
# tornadoapp.py import tornado.ioloop import tornado.webclass Application(tornado.web.Application): def route(self, pattern): def _(handler): handler_pattern = [(pattern, handler)] self.add_handlers(".*$", handler_pattern) return handler return _ app = Application()轉載于:https://www.cnblogs.com/cheyunhua/p/11039550.html
總結
以上是生活随笔為你收集整理的使用装饰器配置路由的的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: (数据科学学习手札61)xpath进阶用
- 下一篇: linux把用户添加到组