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.
This example demonstrates how you can wrap a C API
<!doctype html public "-//w3c//dtd html 4.0 transitional//en"><html><head><metahttp-equiv="Content-Type"content="text/html; charset=iso-8859-1"><metaname="GENERATOR"content="Mozilla/4.51 (Macintosh; I; PPC) [Netscape]"><title>Cython - Front Page</title></head><body> <tableCELLSPACING=0CELLPADDING=10WIDTH="500"><tr><tdVALIGN=TOPBGCOLOR="#FF9218"><fontface="Arial,Helvetica"><fontsize=+4>Cython</font></font></td><tdALIGN=RIGHTVALIGN=TOPWIDTH="200"BGCOLOR="#5DBACA"><fontface="Arial,Helvetica"><fontsize=+1>A
smooth blend of the finest Python </font></font><br><fontface="Arial,Helvetica"><fontsize=+1>with the unsurpassed power </font></font><br><fontface="Arial,Helvetica"><fontsize=+1>of raw C.</font></font></td></tr></table><blockquote><fontsize=+1>Welcome to Cython, a language for writing Python
extension modules. Cython makes creating an extension module is almost as
easy as creating a Python module! To find out more, consult one of the
edifying documents below.</font></blockquote><h1><fontface="Arial,Helvetica"><fontsize=+2>Documentation</font></font></h1><blockquote><h2><fontface="Arial,Helvetica"><fontsize=+1><ahref="About.html">About Cython</a></font></font></h2><blockquote><fontsize=+1>Read this to find out what Cython is all about
and what it can do for you.</font></blockquote><h2><fontface="Arial,Helvetica"><fontsize=+1><ahref="overview.html">Language
Overview</a></font></font></h2><blockquote><fontsize=+1>A description of all the features of the Cython
language. This is the closest thing to a reference manual in existence
yet.</font></blockquote><h2><fontface="Arial,Helvetica"><fontsize=+1><ahref="FAQ.html">FAQ</a></font></font></h2><blockquote><fontsize=+1>Want to know how to do something in Cython? Check
here first<fontface="Arial,Helvetica">.</font></font></blockquote></blockquote><h1><fontface="Arial,Helvetica"><fontsize=+2>Other Resources</font></font></h1><blockquote><h2><fontface="Arial,Helvetica"><fontsize=+1><ahref="http://www.cosc.canterbury.ac.nz/~greg/python/Cython/mpj17-pyrex-guide/">Michael's
Quick Guide to Cython</a></font></font></h2><blockquote><fontsize=+1>This tutorial-style presentation will take you
through the steps of creating some Cython modules to wrap existing C libraries.
Contributed by <ahref="mailto:mpj17@cosc.canterbury.ac.nz">Michael JasonSmith</a>.</font></blockquote><h2><fontface="Arial,Helvetica"><fontsize=+1><ahref="mailto:greg@cosc.canterbury.ac.nz">Mail
to the Author</a></font></font></h2><blockquote><fontsize=+1>If you have a question that's not answered by
anything here, you're not sure about something, or you have a bug to report
or a suggestion to make, or anything at all to say about Cython, feel free
to email me:<fontface="Arial,Helvetica"></font><tt><ahref="mailto:greg@cosc.canterbury.ac.nz">greg@cosc.canterbury.ac.nz</a></tt></font></blockquote></blockquote></body></html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">