Re: exit a program gracefully

2009-05-05 Thread Scott David Daniels
Lawrence D'Oliveiro wrote: It would be nice if Python offered a straightforward equivalent to ... do /*once*/ { ... do stuff ... if (check1_failed) break; ... do even more stuff ... } while (false); ... cleanup goes here ... What's

Re: exit a program gracefully

2009-05-05 Thread Cameron Simpson
On 05May2009 23:28, Lawrence D'Oliveiro wrote: | In message , Gabriel | Genellina wrote: | | > I prefer to put the code inside a function, and just `return` earlier. | | It would be nice if Python offered a straightforward equivalent to | | ... initialization goes here ... | do /*once

Re: exit a program gracefully

2009-05-05 Thread Lawrence D'Oliveiro
In message , Gabriel Genellina wrote: > I prefer to put the code inside a function, and just `return` earlier. It would be nice if Python offered a straightforward equivalent to ... initialization goes here ... do /*once*/ { ... do stuff ... if (check1_failed)

Re: exit a program gracefully

2009-05-04 Thread Gabriel Genellina
En Mon, 04 May 2009 19:14:53 -0300, Chris Rebert escribió: On Mon, May 4, 2009 at 3:02 PM, 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 th

Re: exit a program gracefully

2009-05-04 Thread MRAB
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 perha

Re: exit a program gracefully

2009-05-04 Thread Chris Rebert
On Mon, May 4, 2009 at 3:02 PM, 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

exit a program gracefully

2009-05-04 Thread Robert . T . Lynch
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