def log(func):
def wrapper(*args,**kw):
print 'call %s():'%func.__name__
return func(*args,**kw)
return wrapper
@log
def now():
print 'hello!'
now()
decorator
最新推荐文章于 2024-08-19 13:32:52 发布
def log(func):
def wrapper(*args,**kw):
print 'call %s():'%func.__name__
return func(*args,**kw)
return wrapper
@log
def now():
print 'hello!'
now()