Exit codes in Python

sundeep picture sundeep · Nov 12, 2008 · Viewed 495.3k times · Source

I got a message saying script xyz.py returned exit code 0. What does this mean?

What do the exit codes in Python mean? How many are there? Which ones are important?

Answer

Dave Costa picture Dave Costa · Nov 12, 2008

What you're looking for in the script is calls to sys.exit(). The argument to that method is returned to the environment as the exit code.

It's fairly likely that the script is never calling the exit method, and that 0 is the default exit code.