tkinter shell problem

Eric Brunel eric_brunel at
Thu Nov 25 10:07:09 CET 2004

Philippe C. Martin wrote:
> Hi,
> I have the following problem:
> I wrote a tkinter shell which on a key return event first evals the input 
> buffer (in a try: except:) and then, in case of except, execs the input 
> buffer.
> I have the problem if the exec fails:
> If I trap it, I do not get the stack dump that I which I would show.

Why? When catching an exception, you can get the exception type, the exception 
itself and the traceback object via the sys.exc_info() function. You can then 
use the traceback module to format the traceback just as Python would print it 
if the exception went to the top-most level.

- Eric Brunel <eric (underscore) brunel (at) despammed (dot) com> -
PragmaDev : Real Time Software Development Tools -

More information about the Python-list mailing list