On Mon, May 4, 2009 at 3:02 PM, <robert.t.ly...@seagate.com> wrote: > > In a python program I ask if the user wants to continue. If they answer > 'no', what options do I have to halt execution? I can put the rest of the > code inside an "if bContinue:" block, but that seems awkward. I have looked > at raising an exception, and perhaps this is the preferred method, but it > seems daunting to my non-OOP eyes. Thanks -- Rob
There's the C-like: from sys import exit exit(return_code) Or if you prefer exceptions, the standard way is: raise SystemExit Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list