Re: Injecting code into a function
- From: "George Sakkis" <gsakkis@xxxxxxxxxxx>
- Date: 25 Apr 2005 23:03:57 -0700
> Oh, I overlooked this. Then the solution becomes simple:
>
> sys._getframe().f_trace
>
> Test:
>
> >>> an = Analyzer()
> >>> sys.settrace(an.trace_returns)
> >>> sys._getframe().f_trace
> <bound method Analyzer.trace_returns of <__main__.Analyzer instance
at
> 0x010015D0>>
Does this work for you non-interactively ? I tried running it from a
script or importing it from a module but it returns None. Very
strange...
George
.
- Follow-Ups:
- Re: Injecting code into a function
- From: Kay Schluehr
- Re: Injecting code into a function
- References:
- Injecting code into a function
- From: George Sakkis
- Re: Injecting code into a function
- From: Lonnie Princehouse
- Re: Injecting code into a function
- From: George Sakkis
- Re: Injecting code into a function
- From: Lonnie Princehouse
- Re: Injecting code into a function
- From: Kay Schluehr
- Injecting code into a function
- Prev by Date: Re: Import DiscID on Windows
- Next by Date: Re: web based file manager in python
- Previous by thread: Re: Injecting code into a function
- Next by thread: Re: Injecting code into a function
- Index(es):
Relevant Pages
|