Fix Python – Exit codes in Python

Question

Asked By – sundeep

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?

Now we will see solution for issue: Exit codes in Python


Answer

You’re looking for calls to sys.exit() in the script. 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.

This question is answered By – Dave Costa

This answer is collected from stackoverflow and reviewed by FixPython community admins, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0