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()
>         print "exit ",  urfunc.__name__
>
>         return outcome
>     loggingfun.__name__ =  urfunc .__name__
>     loggingfun.__doc__ =  urfunc .__doc__
>     return loggingfun

Before you go ahead and try this code, I would recommend that you read
a bit about decorators in Python. The one that I usually refer to is
this StackOverflow answer - http://stackoverflow.com/a/1594484.

Thanks & Regards,
Guruprasad
_______________________________________________
BangPypers mailing list
BangPypers@python.org
https://mail.python.org/mailman/listinfo/bangpypers

Reply via email to