Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > main-release > by-pkgid > 98d2a8067c38f8ad1c90c28223e6ee59 > files > 115

python-pyrex-0.9.6.4-1mdv2008.1.x86_64.rpm

This example demonstrates how you can wrap a C API
that has a callback interface, so that you can
pass Python functions to it as callbacks.

The files cheesefinder.h and cheesefinder.c
represent the C library to be wrapped.

The file cheese.pyx is the Pyrex module
which wraps it.

The file run_cheese.py demonstrates how to
call the wrapper.