On Fri, Sep 20, 2013 at 6:06 PM, babmis wrote:
> I want to print entry and exit message for functions , i have bunch of such
> function . How can i do it in decorator.
>>> from functools import wraps
>>>
>>> def trace(f):
... @wraps(f)
... def wrap(*args, **kwargs):
... print("Ent
Hi babmis,
On Fri, Sep 20, 2013 at 6:18 PM, Prashant Gaur <91prashantg...@gmail.com> wrote:
> Hello Babmis ,
>
> Please check below code.
> Let me know if i am wrong.
>
>
> def track(urfunc):
> def loggingfun():
> print "enter " , urfunc.__name__
> outcome = urfunc()
>
Hello Babmis ,
Please check below code.
Let me know if i am wrong.
def track(urfunc):
def loggingfun():
print "enter " , urfunc.__name__
outcome = urfunc()
print "exit ", urfunc.__name__
return outcome
loggingfun.__name__ = urfunc .__name__
logging
I want to print entry and exit message for functions , i have bunch of
such function . How can i do it in decorator.
___
BangPypers mailing list
BangPypers@python.org
https://mail.python.org/mailman/listinfo/bangpypers