Keeping console window open

Fencer no.i.dont at want.mail.from.spammers.com
Sun Jun 7 08:49:57 EDT 2009


Hello, I need to write a simple utility program that will be used under 
Windows. I want to write the utility in python and it will be run by 
double-clicking the the .py-file.

I put a raw_input('Press enter to exit) at the end so the console window 
wouldn't just disappear when the program is finished.

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?

- Fencer



More information about the Python-list mailing list