Does Python code >.require<< a run-time environment?? (New to Python)

Gordon McMillan gmcm at hypernet.com
Sat Jul 15 16:07:40 EDT 2000


Paul Prescod wrote:

> Gordon McMillan wrote:
> > 
> > ...
> > > For Python, you want to look
> > >at
> > >
> > >http://starship.python.net/crew/gmcm/distribute.html
> > >
> > >For Java, at "jexegen.exe".
> > 
> > Sorry, Paul, the latter does not bundle in the interpreter. It
> > just packages up byte code and uses a small exe to start your
> > MS JVM.
> 
> True, I forgot that because the MS JVM tends to be installed. I
> think I may have exaggerated the features of the former too. Is
> there any easy way to make a single executable for Python, the
> standard library, required .pyd's and your code? My vague
> impression is that you could if you had a compiler and the source
> for your pyd's, or else you could fall back on an installer
> (rather than a single big runnable app).

It doesn't create a single statically linked exe. That's kind of 
hard without a compiler. It does track down all your 
dependencies (at least those not masked by import hooks) 
including (on Windows) dlls that your pyds might depend on. 
You end up with an exe and some pyds / dlls in one directory. 

You can then choose how to distribute. You can use a 
installer, (or WinZip), or let Installer create one for you, or even 
send out a one file exe that unzips itself each time it's run.

The major point being that there's no requirement for Python 
on the user's machine, and there's no interference if they have 
a different version of Python installed.

- Gordon




More information about the Python-list mailing list