[OT] pass a C callback function to a cythom module via python

Nadav Horesh nadavh.horesh at gmail.com
Sat Mar 17 01:52:30 EDT 2012


It is good to know that there is still a hope.  In my case I could make it
if only a ctype object would expose the address of the underlying C object.

 Thank you,

     Nadav.

בתאריך 16 במרץ 2012 18:09, מאת Stéfan van der Walt <stefan at sun.ac.za>:

> Hi Nadav
>
> On Mar 15, 2012 10:54 PM, "Nadav Horesh" <nadavh.horesh at gmail.com> wrote:
> >
> > I have the following:
> > A library of C function which is compiled into a dll
> > A cython module with a function that expects as a parameter a C callback
> function.
> >
> > My problem is how to make a python script to pass directly the address
> of a C function from the dll to the cython function.
>
> There's a Cython Enhancement Proposal for this, but it hasn't been
> implemented:
>
> http://wiki.cython.org/enhancements/nativecall
>
> So, I don't think there's a cleaner way, unfortunately. It's great that
> you found a workaround, though--many people have been struggling with this
> issue.
>
> Stéfan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20120317/14196164/attachment.html>


More information about the scikit-image mailing list