Compiled version when .cgi extension is used for scripts

Bernard Niset bn at
Wed May 17 18:25:41 CEST 2000

Right !!!
By the way I have the answer to my question: there is no easy way to use a
compiled version of the scripts. And you are right too, it is fast enough
this way.

Python is a great tool to develop web sites. The web site development I am
currently doing is using Python, Java, CORBA (omniORB, omniORBpy), JSP and
Oracle. It will be a nice mixing of technologies.

Thanks again for your help,

"Thomas Wouters" <thomas at> wrote in message
news:20000517091650.N16186 at
> On Tue, May 16, 2000 at 10:42:18PM +0200, Bernard Niset wrote:
> > > Note that your script would have to be fairly lengthy before you to
> > > actually notice the difference between the two versions.
> > I know but it is still useless to to a compilation each time.
> Useless, probably, slower, maybe, but is the minor speedup really worth
> having to check wether the code should be recompiled, dumping the new
> compiled version to disk, not to mention the clutter it would cause,
> all those .pyc files lying around ? If you really need the speedup, create
> C wrapper that exec()'s python with 'argv[0] + ".pyc"' as argument, and
> update the bytecode version when you want to.
> But dont forget to recompile the compiled version when you install Python
> 1.6, or it wont work :-)
> > > Unfortunately, compiled python scripts need to have the .pyc (or .pyo)
> > > extention for the interpreter to see them as such... If they have any
> > > other name, the python interpreter tries to interpret them as normal
> > > scripts instead. I'm not really sure why, but I guess the variance in
> > > bytecode versions is too great to make the python interpreter
> > > them... I think it would be neat if it could, though.
> > When the script is named differently from .py, the interpreter could use
> > scheme like original_name.ext.pyc.
> Yes, I know, but my point was that you can't rename your '.pyc' file to
> something without a .pyc extention, and still keep it functional. If you
> want to pass a bytecode-compiled version of a script to the python
> interpreter, it *has* to have a name ending on '.pyc'. If this wasn't
> necessary, you could make a 'misc binary' handler on linux that allows you
> to run python bytecode as if they were normal binaries ;-)
> --
> Thomas Wouters <thomas at>
> Hi! I'm a .signature virus! copy me into your .signature file to help me

More information about the Python-list mailing list