[Tutor] Using sys.exit()
Chris Hengge
pyro9219 at gmail.com
Tue Oct 31 07:14:25 CET 2006
Try using SPE, I've really liked it for some of extra features inside it
like TODO tags that are automanaged. Also, its written in python, so thats
kinda cool factor. It's also free.
On 10/30/06, Dick Moores <rdm at rcblue.com> wrote:
>
> At 05:06 PM 10/30/2006, Dick Moores wrote:
> >I'd like to know how to use sys.exit() to quit a program.
> >
> >Here's a simple example:
> >
> >import sys
> >
> >c = 0
> >while True:
> > c += 1
> > if c > 10000:
> > sys.exit()
> >
> >Now, this will certainly exit, but not without a lot of extra noise.
> >Is there a way to use it the way I want to? Maybe with an argument?
> >I'm writing a script, which in a couple of places I can't use "break" to
> quit.
>
> I just found this:
> <
> http://www.velocityreviews.com/forums/t359590-how-to-terminate-a-main-script.html
> >
>
> So the "noise" from sys.exit() is from using it "inside" Wing IDE. At
> the command line, the exit is silent.
>
> Sorry for the disturbance.
>
> Dick
>
>
> >Thanks,
> >
> >Dick Moores
> >
> >_______________________________________________
> >Tutor maillist - Tutor at python.org
> >http://mail.python.org/mailman/listinfo/tutor
>
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20061030/0b9db79a/attachment.html
More information about the Tutor
mailing list