crossplatform py2exe - would it be useful?

Thomas Heller theller at python.net
Thu Aug 7 09:22:47 EDT 2003


Alex Martelli <aleax at aleax.it> writes:

> Thomas Heller wrote:
>    ...
>>>> myscript -c "import sys; sys.path.insert(0, sys.executable); import foo"
>    ...
>>> Sounds like a good idea to me, if a sensible name is chosen for the
>>> "main module" (I propose 'main':-).
>> 
>> My choice would have been __main__ :-) Is it really the correct way to
>> 'import __main__' instead of 'running' it?
>
> Well, most main scripts ARE coded with the "if __name__=='__main__':"
> convention, after all, so an "import __main__" can be seen as a way
> to just piggyback on that existing convention rather than inventing a
> new one in addition.  So, I concede it's better than "import main".

Ok. So who writes the PEP <wink> ?

Thomas




More information about the Python-list mailing list