On 2020-05-28 18:02, Greg Ewing wrote:
If __name__ == '__main__': sys.exit(main(sys.argv[1:]))
It's not clear that exiting with the return value of main() is the most Pythonic thing to do -- it's more of a C idiom that
If you'd like a script to be uhh, highly-scriptable, returning one of the os.EX_* status codes can be useful to communicate back to the calling shell what happened.
First catch the exceptions, convert to the appropriate status code, then return at the end.