[Tutor] compile a python program to .exe

Alan Gauld alan.gauld at blueyonder.co.uk
Fri Apr 16 18:16:11 EDT 2004

> I've a question. I want to compile a program, scripted in python, to
a .exe
> program. This could be done with a compiler.

OK, First I start with my usual caveat. While this is possible
its not necessarily a good thing, it won't bring major
performance boosts for example, it is only really useful for
distributing programs to those without Python installed.
And you might be better installing Python and distributing
the .pyc files instead. Subsequent installs will be smaller
since the exe basically is a combination of the Python
interpreter, all the modules you need plus your code boiled
into a single largish file.

OK, Now assuming that you've considered that and still feel
you need to have a .exe file look at py2exe and Gordon
McMillan's installer. The former is reportedly easiest
to use, while the latter is more powerful (more options).


Alan G.

More information about the Tutor mailing list