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.

Thanks,

Dick Moores

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to