[Python-ideas] making a module callable

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Nov 23 00:21:41 CET 2013


Philipp A. wrote:
>
> |#@mainfunction? or just @main? maybe @entrypoint?

Or to make Java immigrants feel at home, @publicstaticvoid. :-)

> @mainfunction
> def main(args):
>     assert args == sys.argv[1:]

Now we can have an argument about whether args should include
sys.argv[0] or not...

-- 
Greg


More information about the Python-ideas mailing list