#decorator
def before(func):
def wapper(*args):
print "print before invoke foo function"
func(*args)
print "print after invoke foo function"
return wapper
@before
def foo(x):
print "this is dummy function" + x
foo("mm")
def before(func):
def wapper(*args):
print "print before invoke foo function"
func(*args)
print "print after invoke foo function"
return wapper
@before
def foo(x):
print "this is dummy function" + x
foo("mm")