"Dick Moores" <[EMAIL PROTECTED]> wrote > I'd like to know how to use sys.exit() to quit a program. >
I see that you already figured that out. You can also quit by raising SystemExit, which is what sys.exit does... but you don't need to import sys... > Is there a way to use it the way I want to? Maybe with an argument? You can use an argument if you want to pass an error value back to the OS. This is good practice if your script might be used in a batch file or shell script > I'm writing a script, which in a couple of places I can't > use "break" to quit. break is not intended to quit programs, break is intended to quit loops. To exit a program you should use sys.exit() and if its an abnormal exit provide an argument. Alan G. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor