Discuss / Python / 练习题1

练习题1

Topic source

曦冶程

#1 Created at ... [Delete] [Delete and Lock User]
在此插入代码

import functools def print_call(text1, text2): def decotator(func): @functools.wraps(func) def wrapper(args, **kw): print '%s'%text1 def abc(args, kw): print '%s'%text2 return func(*args, kw), abc(args, *kw) return wrapper return decotator

@print_call('start call', 'end call') def f(): print 'Hello world'


  • 1

Reply