What\'s the difference between exit(0)
and exit(1)
in Python?
I tried looking around but didn\'t find a specific question on these lines. I
exit(0)
: This causes the program to exit with a successful termination.
exit(1)
: This causes the program to exit with a system-specific meaning.
On many systems, exit(1)
signals some sort of failure, however there
is no guarantee.
As I recall, the C standard only recognizes three standard exit values:
EXIT_SUCCESS
-- successful terminationEXIT_FAILURE
-- unsuccessful termination0
-- same as EXIT_SUCCESS