标签:python装饰器
def deco(func): print ‘before myfunc() called‘ func print ‘after myfunc() called‘ def myfunc(): print ‘myfunc() called‘ myfunc=deco(myfunc) 输出: before func() called myfunc() called after func() called myfunc() 输出: myfunc() called myfunc() 输出: myfunc() called
本文出自 “技术改变未来” 博客,请务必保留此出处http://auskangaroo.blog.51cto.com/740826/1737708
标签:python装饰器
原文地址:http://auskangaroo.blog.51cto.com/740826/1737708