Discuss / Python / 交一次作业

交一次作业

Topic source

import functools import time

def Log(text=""): def heheda(func): @functools.wraps(func) def asd(args,**kw): print("beginCall") print("%s%s"%(text,func.name)) asd = func(args,**kw) print("EndCall") return asd return asd return heheda

@Log()

def now(): print(time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())))

now()


  • 1

Reply