Is it possible to create C-style "main" function in Python? (for teaching purposes)

alex23 wuwei23 at gmail.com
Tue Oct 4 23:20:34 EDT 2011


Steven D'Aprano <steve+comp.lang.pyt... at pearwood.info> wrote:
> Imported modules are variables like any other, and as they usually exist
> in the global scope, so they will all need to be explicitly referenced as
> global. This will get tiresome very quickly, and is a cure far worse than
> the disease, and alone is enough to disqualify this suggestion from
> serious consideration.

But on the gripping hand, it is a clear triumph of "Explicit is better
than implicit." ;)




More information about the Python-list mailing list