Re: [Tutor] Halting execution

2006-05-03 Thread Ertl, John
rg Subject: Re: [Tutor] Halting execution It would be similar to Perl's die() commmand. But no, in Python the argument is the error status of your script. You'd have to do something like def exitnow(arg): print arg #maybe sys has not been imported import sys sys

Re: [Tutor] Halting execution

2006-05-03 Thread Hugo González Monteverde
It would be similar to Perl's die() commmand. But no, in Python the argument is the error status of your script. You'd have to do something like def exitnow(arg): print arg #maybe sys has not been imported import sys sys.exit(1) Hugo Ertl, John wrote: > Matthew, > > Not su

Re: [Tutor] Halting execution

2006-05-03 Thread Matthew White
Matthew, sys.exit() is one way to do it. Or you could use a conditional to toggle printing the output. -mtw On Wed, May 03, 2006 at 05:35:04PM +0100, Matthew Webber ([EMAIL PROTECTED]) wrote: > This has got to be trivial, but I can't find the answer ... I want to stop > execution of my main sc

Re: [Tutor] Halting execution

2006-05-03 Thread Jason Massey
How about:import syssys.exit()On 5/3/06, Matthew Webber <[EMAIL PROTECTED] > wrote:This has got to be trivial, but I can't find the answer ... I want to stop execution of my main script half way through. This is just for debugging -the code in the bottom half of the script generates a whole lot of

Re: [Tutor] Halting execution

2006-05-03 Thread Ertl, John
Behalf Of Matthew Webber Sent: Wednesday, May 03, 2006 9:35 AM To: tutor@python.org Subject: [Tutor] Halting execution This has got to be trivial, but I can't find the answer ... I want to stop execution of my main script half way through. This is just for debugging - the code in

[Tutor] Halting execution

2006-05-03 Thread Matthew Webber
This has got to be trivial, but I can't find the answer ... I want to stop execution of my main script half way through. This is just for debugging - the code in the bottom half of the script generates a whole lot of output that I don't want. Inserting "break" or "return" doesn't work, but somethin