2009/6/7 Fencer <[email protected]>
> Anyway, I wrote a few lines of code and when I first tried to run it by > double-clicking the .py-file the console window still disappeared right > away. So, in order to see what was happening, I ran it from a shell and it > turned out to be a missing import. My question is how can I trap errors > encountered by the interpreter (if that is the right way to put it) in order > to keep the console window open so one has a chance to see the error > message? > > I don't think this (force a console window to be kept openning only for debug purpose) is a good idea. If you just write some lines to learn something, you may run your script in a console window or in an IDE. If you are writing a big project, you'd better catch those exception and store logs in some files. However, if you still need force a console window be kept openning after the script end, you may use module atexit. -- XUE Can
-- http://mail.python.org/mailman/listinfo/python-list
