Python Linux Exit Codes

Sometimes you need to create scripts that give an exit status code to the calling program. Here is some info with exit codes with special meaning

At it’s code:

  • 0 - means successful
  • 1 - 255 - means failure / error

In python that is done using sys.exit():

import sys
# fail
sys.exit(1)