Differences between revisions 1 and 2
Revision 1 as of 2004-09-23 14:30:07
Size: 466
Editor: mail
Comment:
Revision 2 as of 2004-09-23 14:36:19
Size: 523
Editor: mail
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
If you specify the optimize option in your setup.py this will only be used for the compiling of the needed modules, not for your main module! If you have the following setup.py: If you specify the '''optimize''' option in your ''setup.py'', this will only be used for the compiling of the needed modules, not for your main module! For example if you have the following ''setup.py'':
{{{
#!python
Line 10: Line 11:

The bytecode embedded in the resulting .exe will not be optimised. To get optimised bytecode, you need to call the setup.py like so:
}}}
The bytecode embedded in the resulting .exe will not be optimised. To get optimised bytecode, you need to call the ''setup.py'' like so:
{{{
Line 13: Line 15:
}}}

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

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

The bytecode embedded in the resulting .exe will not be optimised. To get optimised bytecode, you need to call the setup.py like so:

python -OO setup.py py2exe

OptimizedCode (last edited 2008-07-08 11:27:43 by localhost)