How to create a single executable of a Python program

Harlin Seritt harlinseritt at yahoo.com
Wed Jul 25 12:38:48 CEST 2007


On Jul 25, 6:19 am, Graeme Glass <graemegl... at gmail.com> wrote:
> On Jul 25, 8:34 am, NicolasG <nicol... at gmail.com> wrote:
>
> > Dear fellows,
>
> > I'm trying to create a executable file using py2exe . Unfortunately
> > along with the python executable file it also creates some other files
> > that are needed in order to the executable be able to run in a system
> > that doesn't have Python installed. Can some one guide me on how can I
> > merge all this files created by py2exe in a single exe file ? If I
> > have a python program that uses an image file I don't want this image
> > file to be exposed in the folder but only to be accessible through the
> > program flow..
>
> > Regards,
> > Nicolas.
>
> Have you taken a look at cx_Freeze? (http://python.net/crew/atuining/
> cx_Freeze/)http://www.velocityreviews.com/forums/t354325-singlefile-executables....


If you're using py2exe (I'm assuming Win32 platform here), you can do
this but you'll have to read the documentation on how to include the
library.zip file into the exe. Also there are different levels where
the .exe file will include the .pyd files. Unfortunately though, you
will likely encounter errors doing it the more you try to "condense".
If you can solve this problem, heck tell the guys at py2exe ;-) they
have been trying to solve this issue for some time now. If you're
doing it with Linux/Unix, cx_freeze is the only way i know to get this
done and even then it may have the same limitations. If you're trying
to hide/proprietize code, you may want to use pyobfuscate.

Good Luck

Harlin Seritt




More information about the Python-list mailing list