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

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to