Popular recipes by pink chry http://code.activestate.com/recipes/users/99417/2001-06-19T15:01:52-07:00ActiveState Code RecipesImplementing C function callbacks using Python (Python)
2001-06-19T15:01:52-07:00pink chryhttp://code.activestate.com/recipes/users/99417/http://code.activestate.com/recipes/65210-implementing-c-function-callbacks-using-python/
<p style="color: grey">
Python
recipe 65210
by <a href="/recipes/users/99417/">pink chry</a>
(<a href="/recipes/tags/extending/">extending</a>).
Revision 2.
</p>
<p>Lets say you have a function in C or C++ that takes a function callback as an argument. You want to call this function by passing a Python function as the callback. This recipe shows the basics by calling the standard C library function qsort, and passing a python function as the compare function.</p>