The convention is that sys.exit(...) is called only if a module is run as a script, and that main() entry points use return statements to report exit codes: 0 (or None) for successful execution, or any non-zero integer for errors. E.g. see the console scripts generated when installing with pip.
This directory includes snippets that people might useful to get ideas from. The contents will come and go, don't rely on them being there or having a certain API. If you need it, copy it and modify it.
If you do and think your work is useful for others, please add a link to it here: