How to optimised with embedded Python ?

Emmanuel eastier at free.fr
Mon Feb 2 01:53:03 CET 2004


Actually, I found a solution :
Just after the python initialize, I increment Py_OptimsedFlag :

(...)
 Py_Initialize();
 Py_OptimizeFlag++;
(...)

Works like a charm !!

Thanks for your help,

Emmanuel

"John J. Lee" a écrit :

> Emmanuel <eastier at free.fr> writes:
>
> > I would like to use optimised python scripts ( *.pyo ), in order to gain
> > space.
> > But I use an embedded python. The compiler can only be run from my
> > application.
> > How do I set the compiler, from the C api, to create optimised files ?
>
> There's a "compileall" script in the source distribution that should
> show you how to do it.
>
> John




More information about the Python-list mailing list