[Tutor] py2exe

jfouhy@paradise.net.nz jfouhy at paradise.net.nz
Sat Jul 9 12:15:44 CEST 2005

Quoting "D. Hartley" <denise.hartley at gmail.com>:

> I modified the setup.py file to match the details of my game (as best
> I can imagine: I don't know what "optimize = 2 #0,
> 1, or 2; like -O and -OO" means, so I just left it as his sample had
> it, 

>From python -h:

-O     : optimize generated bytecode (a tad; also PYTHONOPTIMIZE=x)
-OO    : remove doc-strings in addition to the -O optimizations

optimize=2 means py2exe will optimize the bytecode and remove doc strings; this
is probably OK since you're not going to be running the debugger on your
finished executable.

> and I'm not sure if I put in all of the module names it will need
> specified, but it looks as if its supposed to give me an error if it
> can't find them). 

py2exe will search for all the modules it thinks it needs, but sometimes it will
miss some.  Generally, the best way to find out if it missed anything is to run
your executable and see if it crashes :-)

> But then the tutorial says "simply run this script
> and it will do all the work. 

You need to run it from the command line: python setup.py py2exe



More information about the Tutor mailing list