I'm using a Python script to farm out some subprocesses to some other Python scripts. I need to make sure the Python subprocesses run successfully. Is there a convention on whether it is better to exit(0)
or return 0
at the end of a successfully run Python script?
I don't think it matters from a functional perspective, but I'm wondering whether one is preferred.
sys.exit(0)
is more clear, also checkout the errno module for standard exit codes.main
function so your choice is to callsys.exit
or not calling it. There's no such a thing asreturn 0
, since it would raise aSyntaxError
when outside a function.