Minimal distro requirements for standalone python program....

Daniel Dittmar daniel.dittmar at sap.com
Tue Mar 2 16:22:41 CET 2004


jeuxal_com wrote:
> Context: I want to add some python capabilities to my application,
> but not force the user to install the full python distro.
> Questions:
>     1- Are these files sufficient? (Too simple to be true!)

As python can now inport from .zip, you could add the python files as a
.zip:
- run compileall.py on <pythondir>/Lib to generate .pyc
- pack all the files into python23.zip
- if you install python23.zip into the same directory as the .exe, then I
think the file will already be added to sys.path

Hints:
- specify a nonsense directory to the -d option of compileall.py. Otherwise,
any backtraces will contain plausible filenames that do not exists on that
machine
- adding the .py files is optional
- python will not import .pyd from the .zip file

>     2- Is their some registry/path entries do perform to setup a
> minimal python runtime?

No, python will search for the files relative to the executable.

Daniel






More information about the Python-list mailing list