program termination and return value
littlejohn.75 at noos.fr
Fri Oct 8 22:33:43 CEST 2004
On 8 Oct 2004 13:20:51 -0700, Scott Carlson <scarlson at omnimn.com> wrote:
> Python novice. (But getting better.)
> How do I terminate/quit my program during execution if I reach a point
> where I desire to terminate the program?
> How do I pass back an integer indicating (as example) an error number?
raise SystemExit(2) # error number 2
> If I then do this, what do I put on the last line of my program to
> return (for example) a zero, indicating success?
noting : an equivalent to sys.exit(0) or raise SystemExit(0) is
You can also use :
on the python prompt :
More information about the Python-list