Re: keep console window after double-click foo.py

2007-03-23 Thread smr
On Thu, Mar 22, 2007 at 02:24:20PM -0700, Trent Mick wrote: > Try this: > > try: > main() > except: > import traceback > print "The script crashed:" > traceback.print_exc() > print "Press RETURN to exit..." > sys.stdin.readline() Beautiful, thanks! As you and Frank Müll

Re: keep console window after double-click foo.py

2007-03-22 Thread Frank Müller
Hi Steve, take a look at part 8.3 Handling Exceptions of the Python tutorial. It states: "The try ... except statement has an optional /else clause/, which, when present, must follow all except clauses. It is useful for code that must be executed if the try clause *does not* raise an exception.

Re: keep console window after double-click foo.py

2007-03-22 Thread Trent Mick
> I'd like the window to stick around if there are any exceptions > raised. I tried to put all my code in function main() and use > > try: > main() > except None: > raise > else: > print "Press RETURN to exit..." > sys.stdin.readline() > > No dice: the window closes even if main(

keep console window after double-click foo.py

2007-03-22 Thread smr
Howdy, I installed Active State Python, and wrote a simple script, say 'foo.py'. If I double-click on 'foo.py' from the windows explorer, a console window opens, the script executes, and the window closes again. I'd like the window to stick around if there are any exceptions raised. I tried to