def deco(func):
def wrapper():
print("1 before myfunc() called.")
func()
print(" 2 after myfunc() called.")
return wrapper


@deco
def myfun():
print("myfun")
myfun()
posted on 2017-05-28 22:50  mljqqh  阅读(94)  评论(0编辑  收藏  举报