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
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
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
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
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
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