is there a Python compiler?

Scott J. Henson scotth at csee.wvu.edu
Wed Mar 15 15:21:02 UTC 2006


Norton Roman wrote:
>
> Actually, it interpretes the code (.py files). However, it also
> generates a bytecode (.pyc files) to run on its virtual machine, in
> the case you don't change the original source file. This way, it runs
> faster code that you did not change.

Actually, it generates the byte code first then executes that.  If it
can, it writes the resulting compiled byte code to the filesystem so it
doesn't have to compile it next time.   There is also the -O option to
write optimized byte code.  If you notice, many python modules and
programs byte compile themselves(both regular and optimized) at install
time so that they start faster.  But the runtime is always the same
regardless of if its pre-compiled to byte code or not.

But, yes, python is a mainly an interpreted language, though there are
things like iron python, which I believe compiles itself to CLR byte code. 




More information about the ubuntu-users mailing list