21 lines
393 B
Python
21 lines
393 B
Python
|
|
"""
|
|
def log(func):
|
|
def new_func(*args):
|
|
r = func(*args)
|
|
print(">>> " + str(func).split(" ")[1] + str(list(args)) + " -> " + str(r))
|
|
return r
|
|
return new_func
|
|
"""
|
|
|
|
|
|
|
|
def log(f):
|
|
def g(*args):
|
|
r = f(*args)
|
|
print("Calculating: %s(%s) = %s" % ( str(f).split(" ")[1], str(",".join(map(str,list(args)))), str(r)) )
|
|
return r
|
|
return g
|
|
|
|
|