Re: stopping execution window on error - newbie

2010-05-14 Thread a
On 14 May, 00:14, Mensanator wrote: > On May 13, 4:00 pm, a wrote: > > > I'm coding on an old windows laptop > > > i write the code and double click the icon.   > > Don't do that. > > > it runs the program and > > writes results to a window. > > > when the code finishes, the window closes, i do a

Re: stopping execution window on error - newbie

2010-05-13 Thread Mensanator
On May 13, 4:00 pm, a wrote: > I'm coding on an old windows laptop > > i write the code and double click the icon.   Don't do that. > it runs the program and > writes results to a window. > > when the code finishes, the window closes, i do a time.sleep(10) to > see what has happened. > > unfortu

Re: stopping execution window on error - newbie

2010-05-13 Thread Matteo Landi
Place a try .. except surrounding the body of your program, and finally call the input() function. On Thu, May 13, 2010 at 11:00 PM, a wrote: > I'm coding on an old windows laptop > > i write the code and double click the icon. it runs the program and > writes results to a window. > > when the c

stopping execution window on error - newbie

2010-05-13 Thread a
I'm coding on an old windows laptop i write the code and double click the icon. it runs the program and writes results to a window. when the code finishes, the window closes, i do a time.sleep(10) to see what has happened. unfortunately when there is an error it just closes the window. anyway o

Re: Stopping Execution

2005-11-10 Thread gblais
surely you mean sys.exit() Gerry -- http://mail.python.org/mailman/listinfo/python-list

Re: Stopping Execution

2005-11-10 Thread Steve Holden
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > >>import sys >>sys.exit > > > $ more test.py > import sys > print "should get here" > sys.exit > print "should never get here" > > $ python test.py > should get here > should never get here > Which is Fredrik's way of telling you you need to

Re: Stopping Execution

2005-11-10 Thread James Colannino
Fredrik Lundh wrote: > the usual way: > >sys.exit() # or "raise SystemExit" >[...] > Ah, thank you. I wasn't aware that I'd have to import a module to have that ability. I'm still very new, so I have a lot to get used to :-P James -- My blog: http://www.crazydrclaw.com/ My homepage: htt

Re: Stopping Execution

2005-11-10 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > import sys > sys.exit $ more test.py import sys print "should get here" sys.exit print "should never get here" $ python test.py should get here should never get here -- http://mail.python.org/mailman/listinfo/python-list

Re: Stopping Execution

2005-11-10 Thread robert . dowell
import sys sys.exit -- http://mail.python.org/mailman/listinfo/python-list

Re: Stopping Execution

2005-11-10 Thread Fredrik Lundh
James Colannino wrote: > Hey everyone. I remember from my C programming that I can either use > the exit() or return() functions to end execution of the main code > block. My question is, is there a way for me to do this in Python? I > know there has to be, but I can't for the life of me figure

Stopping Execution

2005-11-10 Thread James Colannino
Hey everyone. I remember from my C programming that I can either use the exit() or return() functions to end execution of the main code block. My question is, is there a way for me to do this in Python? I know there has to be, but I can't for the life of me figure out what it is. The reason