在web.py中使用装饰器
先上代码 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 import web urls = ( '/', 'hello', ) app = web.application(urls, globals()) def hold(func): print 'run hlod' def f(self): print 'in hold func' return 'hold' return f class hello: @hold def GET(self): print 'in hello' return 'hello' if __name__ == "__main__": app.run() 现在的问题