Re: [OT] pass a C callback function to a cythom module via python
You can see how we did this before with the opencv wrappers starting at line 117 of this file: https://github.com/scikits-image/scikits-image/blob/0.3.1/scikits/image/open... On Sat, Mar 17, 2012 at 2:35 PM, Chris Colbert <sccolbert@gmail.com> wrote:
cytpes.addressof(...) On Mar 17, 2012 12:52 AM, "Nadav Horesh" <nadavh.horesh@gmail.com> wrote:
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@sun.ac.za>:
Hi Nadav
On Mar 15, 2012 10:54 PM, "Nadav Horesh" <nadavh.horesh@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
participants (1)
-
Chris Colbert