March 2003
Intermediate to advanced
656 pages
39h 30m
English
exit
exit(arg=0)Raises a SystemExit exception, which normally
terminates execution after executing cleanup handlers installed by
try/finally statements. If
arg is an integer, Python uses
arg as the program’s exit
code: 0 indicates successful termination, while
any other value indicates unsuccessful termination of the program.
Most platforms require exit codes to be between 0
and 127. If arg is not
an integer, Python prints arg to
sys.stderr, and the exit code of the program is
1 (i.e., a generic unsuccessful termination code).