A few q's on python files.

Peter Hansen peter at engcorp.com
Thu Feb 24 21:17:27 EST 2005


Tim Roberts wrote:
> There are packages (like py2exe) that can convert your script into an
> executable, but they are essentially installers.  They package your script,
> and all the scripts and libraries it needs, into a single file along with
> the interpreter.  When the .exe is executed, it extracts the interpreter
> and the scripts into a temp directory, and fires up the interpreter.

Correction: py2exe doesn't really do that at all.  At least,
not any of the "single file" or "extracting" stuff.

Py2exe packages all the Python bytecode into a single zip
file (library.zip) and also includes all .pyd and .dll
files required to run the program, along with a stub
.exe file which instantiates an interpreter (from pythonXX.dll)
and runs the main script.

Installers such as InnoSetup are what you use to do the
"single file" stuff, and when you run them they do the
usual Windows installer stuff like extracting files to the
installation directory, creating icons, etc.

Finally there are tools (names don't come to mind since I don't
use them, but they're easy to find) which *can* do that
"extract to temporary directory" thing rather than the InnoSetup
type of installer, but they're relatively rarely used I think.

-Peter



More information about the Python-list mailing list