How does python bytecode works?

Dan Stromberg drsalists at gmail.com
Sun Jun 17 19:57:11 EDT 2012


On Sun, Jun 17, 2012 at 2:54 AM, gmspro <gmspro at yahoo.com> wrote:

> We know python is written in C.
>
Yes, at least CPython is.  Of course, java is written in C, as are many
other languages.


> C is not portable.
>
C gives you lots of rope to hang yourself with, but if you use C well, it's
more portable than anything else, including the "portable" languages (the
ones that don't give you much rope).


> So how does python work on a webserver like apache/httpd for a python
> website?
>
I guess this is kind of like asking how you breathe.  Python just gets
exec'd or dlopen'd or something.


> How does the intermediate language communicate with server without
> compiling python code?
>
CPython is to .pyc as java is to .class.  They're both byte-compiled.  Java
is more commonly JIT compiled than CPython, but Python in general does
allow JIT compilation.

IOW, CPython is compiled, it just doesn't burden the developer with a
separate compile step.


> Or how does python interpreted code work with webserver for python based
> websites?
>
Please see above.


> Please elaborate/explain this topic with example.
>
You may get better answers if you get into more specifics about what your
question really is.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120617/49553686/attachment.html>


More information about the Python-list mailing list