Is there any advantage to using a main() in python scripts?

Chris Angelico rosuav at
Wed Dec 11 11:41:47 CET 2013

On Wed, Dec 11, 2013 at 9:26 PM, Ben Finney <ben+python at> wrote:
>         except SystemExit, exc:

For new code, you'd of course want to write that as:

except SystemExit as exc:

which is compatible with Python 2.6, 2.7, and 3.x, while the other
syntax is 2.x only.


More information about the Python-list mailing list