simple(?) Python C module question

geremy condra debatem1 at
Thu Nov 18 01:28:39 CET 2010

On Wed, Nov 17, 2010 at 3:35 PM, Grant Edwards <invalid at invalid.invalid> wrote:
> On 2010-11-17, Mark Crispin <nospam at> wrote:
> Hey, it's the IMAP guy!  Get 'im!
>> I have a Python module written in C that interfaces with an external
>> C library.  Basically, the project is to make it possible to use that
>> library from Python scripts.  If you know who I am, you can guess
>> which library.  :)
> Have you looked at ctypes?  It's not suitable for all libraries, but
> it can often obviate the need to write any C code:

This. You may also want to check out [0] and [1], which use ctypes and
generally make short work of writing C bindings. For a more complete
example, see [2].

Geremy Condra


More information about the Python-list mailing list