Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from cProfile import runctx
- def profile_decorator(fun):
- def wrap(*args, **kw):
- globals()['funct'] = fun
- result = []
- runctx('result.append(funct(*args, **kw))', globals(), locals())
- #return funct(*args, **kw)
- return result[0]
- return wrap
Add Comment
Please, Sign In to add comment