Wrapping C with Python

RPM1 rpm9deleteme at earthlink.net
Mon Aug 4 18:39:26 EDT 2008


brad wrote:
> RPM1 wrote:
> ...
>> Basically you just compile your C code as a regular C code dll.  
>> ctypes then allows you to access the functions in the dll very easily. 
> 
> Does that work with C++ code too or just C?

I believe it does work with C++ although I have not done that.  Here's a 
simple example:

http://wolfprojects.altervista.org/dllforpyinc.php

I bet if you google around you'll find what you need.

Remember there is documentation for ctypes in the Python documentation 
that comes with Python.

Patrick



More information about the Python-list mailing list