def foo():
pass
def bar():
print \'good bay\'
two function like blow and now i want to run bar function after foo run finish
is th
Why not:
foo()
bar()
?
In case you want to have some general way to do it, you can try:
def run_after(f_after):
def wrapper(f):
def wrapped(*args, **kwargs):
ret = f(*args, **kwargs)
f_after()
return ret
return wrapped
return wrapper
@run_after(bar)
def foo():
....
This way bar is always run after foo is executed.