摘要:
装饰器简介:@decoratorclass C:pass'''等于'''C = decorator(C)最简单的装饰器函数,写一个计时器import timedef timer(fu): def insfnc(): strat = time.clock() fu() end = time.clock() print('\n',strat,end) print('usetime : %r'%(end-strat)) return insfnc@timer ... 阅读全文
posted @ 2013-11-23 12:36
kolaman
阅读(171)
评论(0)
推荐(0)
浙公网安备 33010602011771号