Newbie: Python + C Question

Peter Hansen peter at engcorp.com
Tue Apr 8 19:17:02 EDT 2003


laotseu wrote:
> 
> bourassa wrote:
> > When Python uses the C extension does it just process
> > it in an interpreted fashion
> 
> Python is not a C interpreter.
> 
> > or does the code written in C run like a
> > compiled C program?
> 
> newbie to programming, uh ?-)
> 
> How do you think this all works ?

Actually, to be fair to the OP, this is a valid and even interesting
question.  Where, after all, does it say that the C code that is
in the extension is actually pre-compiled into an executable and
is run as machine code when called by Python?  (Maybe it's there
in the docs, but maybe it's not or maybe it's unclear.  Have you
checked?)

I could picture someone believing that Python had the ability to
execute C code interpretively via some fancy C-interpreter
extension, which would allow the existing code-base of C to be 
used within an otherwise-pure-Python program.  Definitely not
very likely to happen as a general feature, but still an interesting
concept.

-Peter




More information about the Python-list mailing list