How to get existing frames in non-current thread?

Fabio Zadrozny fabiofz at gmail.com
Sun Jun 10 08:17:21 EDT 2007


On 6/10/07, Gabriel Genellina <gagsl-py2 at yahoo.com.ar> wrote:
>
> En Sat, 09 Jun 2007 21:40:40 -0300, Fabio Zadrozny <fabiofz at gmail.com>
> escribió:
>
> > Is there some way to get all the frames for any given thread? -- in a
> way
> > that does not require a compiled extension.
>
> For the current (calling) thread, you can use sys._getframe()
> For other threads, you can use sys._current_frames()
> Frames have a f_back attribute pointing to the previous one, that you can
> use to navigate them.
>

Thanks a lot... I guess I'll have to find another way for versions before
2.5 ;-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070610/3888ecb3/attachment.html>


More information about the Python-list mailing list