embedded python pythonpath

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Tue Mar 25 20:33:52 EDT 2008


En Tue, 25 Mar 2008 20:38:39 -0300, Furkan Kuru <furkankuru at gmail.com>  
escribió:

> Actually, I do not want any .py or .pyc files around my executable.
> (including userdict, sys, site etc)
> I want to have just single zip file for all python files.

Putting all of them into pythonNN.zip (NN depending on the Python version  
in use) should be enough, but I've never tried it.

> I had a look at py2exe source codes but could not figure out how it just
> looks into a zip file.

Standard Python already supports having zip files in sys.path (using the  
builtin zipimport module), you don't have to do anything special to enable  
that (apart from building with the required dependencies, like zlib, of  
course)

> So maybe I have to compile the svn version of python.

After renaming the directory where Python 2.5 were installed, my  
test25.exe program (the one compiled using Python 2.5.1) worked fine. So  
it looks like it is something with how the "python home" is searched.

Anyway, as I said earlier, you don't have to play with PYTHONPATH; just  
add any required directory to sys.path at runtime.

-- 
Gabriel Genellina




More information about the Python-list mailing list