NEWBIE: Extending Python with C

Mark Hammond mhammond at skippinet.com.au
Mon Nov 11 05:30:23 EST 2002


Dennis Lee Bieber wrote:

>         Need speed, and some access to a posix thread system...

Any Python portable thread system.

>         IMO, I'm going to present some bad news...
> 
>         From what you've said, I'd almost think you were coming at it from the 
> wrong direction. 
> 
>         /I/ think what you'll end up with is a C/C++ application with an 
> embedded Python interpreter for your scripting, and maybe for part of 
> the graphical part of the user-interface... But the rest of the 
> application strongly sounds like it needs to be ported to a different 
> OS (drop the MS-DOS mode for Windows or Linux) and cleaned up -- 
> remaining in C or rewritten in C++.

I don't agree.  I think the approach he outlined is correct.  I believe 
a common mistake is to think "app with embedded Python", when what you 
really mean, and ended up with, is "python with embedded app".

To the OP: Creating a Python extension is quite trivial.  The Python 
source tree has at least one example extension module in PC\example_nt, 
and others should be simple to find - indeed mine and Andy's book has 
such an example.

So I'm really not sure what the question boils down to ;)

Mark.




More information about the Python-list mailing list