Looking for a way to stop execution of script, in the script

Josh Bloom joshbloom at gmail.com
Tue Nov 14 13:32:44 EST 2006


Hi everyone, I'm looking for a way to stop execution of a script from within
the script.

I'm familiar with this idiom:

While 1:
  doFirstThing()
  doSecondThing()
  if something:
    break
  doThirdThing()
  break

But that seems a little kludgy to me with extra breaks involved.
Is there a way to do something like this?

doFirstThing()
doSecondThing()
if something:
    die
doThirdThing()

Thanks for the help,
Josh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20061114/fada5598/attachment.html>


More information about the Python-list mailing list