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.
-Mike
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/python-ideas@python.org/message/4WRFUNV5U7WVTQDJOA3AJFZVMFJXVY5K/
Code of Conduct: http://python.org/psf/codeofconduct/