interpreter frame

Peter Hansen peter at
Thu Aug 11 14:22:29 CEST 2005

Leo wrote:
> Good try, but that doesn't seem to work either. Maybe I should have
> emphasized that what I really want is the line of code, as opposed to
> the entire frame. 

Ah, it wasn't clear from your first post that you were specifically 
interested in a line you entered at the *interactive prompt*.  The word 
"interpreter" is sometimes applied to the virtual machine, so I thought 
you just wanted the current frame inside an application.

For the "interactive interpreter", I doubt the line of code that you are 
executing is preserved anywhere (at least not in a supported, documented 
fashion) as source, so I don't think there's a simple way to get at it. 
  Certainly not (I believe) through the frame or code object.  Maybe 
checking the source will lead to a hack solution...


More information about the Python-list mailing list