If you specify the optimize option in your, this will only be used for the compiling of the needed modules, not for your main module!
For example if you have the following

   1 from distutils.core import setup
   2 import py2exe
   4 setup(
   5         options={"py2exe":{"optimize":2}},
   6         console=[""]
   7 )

The bytecode embedded in the resulting .exe will not be optimised.


To get optimized bytecode, you need to call the like so:

python -OO py2exe

OptimizedBytecode (last edited 2008-07-08 11:27:44 by localhost)