[Cython] Callback functions for C lib in Python

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Apr 27 01:28:35 CEST 2009


Stefan Behnel wrote:

> I imagine that your question implies: "how do I pass some state into the
> callback function?". That depends on the library you are using, maybe it
> passes something into the callback function that you can control from your
> outside code.

And if there really isn't anything passed to the callback
that you can attach your own data to, you'll just have
to store the Python function globally and put up with
only being able to have one callback installed at a
time.

-- 
Greg



More information about the Cython-dev mailing list