Newbie: Python + C Question

myk mykbourassa at cogeco.ca
Wed Apr 9 09:57:56 EDT 2003


Thanks for the comments.  I'm not a programmer and am trying to switch 
from Matlab (8 yrs exlusive use) to a "real" programming language for 
flexibility and cost reasons.  I was reading through "Learning Python" 
but the answer to the question of where the compiler comes from (esp. in 
Windows) I eventually found, partly, here:

http://www.python.org/dev/doc/devel/inst/tweak-flags.html

Cheers.

Peter Hansen wrote:

>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