Single-file executables

Thomas Heller theller at python.net
Sun Feb 12 16:12:54 EST 2006


Martin v. Löwis wrote:
> Kevin Walzer wrote:
>> The apps I've seen created by py2exe aren't single-file at all, the
>>  install folder is full of files besides the main program. I'm 
>> looking for a solution that stuffs all libraries, scripts, and the
>>  Python runtime into one file.

Usually the bundle=1 option in py2exe can create a single file exe, but it also
allows to have a separate shared library.zip file, which is useful if you need more than
one exe-file.  With python 2.4, MSVCR71.dll is still required and not bundled.  There are 
technical reasons ('booting' the exe) and maybe legal reasons for that.


> For full control, and truly single-binary executables, I recommend to
> use freeze itself. It takes a bit more work, but also gives better 
> results.


I wonder if anyone is actually using freeze on Windows, with scripts that use,
say, pywin32 and wxPython.

I've said it before, and say it again: Creating real single-file exes or dlls
was a non-goal for py2exe.  The goal was to be able to create in-process COM
servers which provide a python interpreter that is totally isolated from possible
other interpreters running in the same process.

py2exe simulates a statically linked python interpreter together with statically
linked extension modules.  So, it is very similar to what freeze creates.

Thomas




More information about the Python-list mailing list