crossplatform py2exe - would it be useful?
theller at python.net
Thu Aug 7 14:46:24 CEST 2003
Alex Martelli <aleax at aleax.it> writes:
> Oren Tirosh wrote:
>> On Wed, Aug 06, 2003 at 08:36:20PM +0200, Thomas Heller wrote:
>>> I'm currently working on a new version of py2exe, which will require
>>> Python 2.3 and later, because it uses the zipimport mechanism.
>> Now that zipimport is part of Python the code required for bootstrapping
>> a py2exe runtime is just:
>> myscript -c "import sys; sys.path.insert(0, sys.executable); import foo"
>> This reduces the difference between the custom interpreter supplied with
>> py2exe and the standard interpreter to just a few lines of C.
>> The obvious question is - why not go all the way and put this little
>> hook into the standard Python distribution? This way py2exe could be a
>> platform-independent pure Python application. In fact, py2exe wouldn't
>> actually be necessary because anyone could create a zip file manually and
>> append it to the executable but it's more convenient to have a tool that
>> automates the process and finds the required dependencies.
> 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?
> Take it to Python-Dev...? I even wonder if it's unobtrusive enough to
> be considered (as a "bugfix"...:-) for 2.3.1, rather than having to
> get into 2.4 and thus wait a LONG time...
More information about the Python-list