If you use Python -OO is it a permanent condition??

Jeff Sasmor jeff at sasmor.com
Mon Jun 17 23:53:37 CEST 2002


'Fascinating'
I'm sure there's a logical reason... somehow. Anyway, I found
that if I renamed all the .pyo files to .pyc everything works fine.
I guess that's because there's little difference between them. It's
too bad that there's no way to switch optimized mode on and
off programmatically - would be useful for apps that use compile().

--
#--------------------------------
Jeff Sasmor
jeff at sasmor.com
"Aahz" <aahz at pythoncraft.com> wrote in message
news:aelamd$fo1$1 at panix1.panix.com...
> In article <rXpP8.32471$ks6.25445 at nwrddc02.gnilink.net>,
> Jeff Sasmor <jeff at sasmor.com> wrote:
> >
> >So  I tried:
> >
> >python -OO P1.pyo
> >
> >and it works just fine.  Does this mean that the interpreter must
> >always be started with -OO to execute files compiled with -OO?  I can't
> >imagine why this would be the case, but it seems to be -- at least as
> >far as I can see from my little bit of experimentation.
>
> Python doesn't search for .pyo files unless it is running in optimized
> mode.  Try setting the PYTHONOPTIMIZE env var.
> --
> Aahz (aahz at pythoncraft.com)           <*>
http://www.pythoncraft.com/
>
> Project Vote Smart: http://www.vote-smart.org/





More information about the Python-list mailing list