how to get the last interactive command enetered

Martin von Loewis loewis at
Sat Mar 3 10:47:48 CET 2001

"Tom" <NoSpam at> writes:

> For example, say that I set a trace function.  I find the frame's code
> object, look at co_filename and find that it is <stdin>.  But I want to know
> what the actual command was.  Is there anyway to do this (in C or Python)?

No. Once the code is executed, the source code is dropped. All you can
get at is the binary code.

Of course, "in C", you can rewrite the Python interpreter to behave
differently. It takes more than an extension module to do so, though.


More information about the Python-list mailing list