Discuss / Python / 第一

第一

Topic source

def log(func): def wrapper(args,**kw): print('begin call') print('call %s():' % func.name) func(args,**kw) print('end call') return wrapper

@log def now(): print('2016-4-11')

now() begin call call now(): 2016-4-11 end call


  • 1

Reply