interpreter frame

Leo leo.uaz at gmail.com
Wed Aug 10 12:06:38 EDT 2005


Why is it not possible to get the frame from the interpreter using the
inspect library? IOW, why does this code:

>>> from inspect import *
>>> stack()

produce:

[(<frame object at 0x81b6d94>, '<stdin>', 1, '?', None, None)]

instead of:

[(<frame object at 0x81b6d94>, '<stdin>', 1, '?', '\tstack()', 0)]

?

I must be missing something. The motivating question is:

How can I get the interpreter line that triggered the current actions?

TIA,
Leo.




More information about the Python-list mailing list