Function References

Chris Mellon arkanes at gmail.com
Thu Jul 31 13:39:50 EDT 2008


On Thu, Jul 31, 2008 at 10:27 AM, squishywaffle at gmail.com
<squishywaffle at gmail.com> wrote:
> On Jul 31, 10:47 am, "Diez B. Roggisch" <de... at nospam.web.de> wrote:
>> I take the freedom to do so as I see fit - this is usenet...
>
> Fine, then keep beating a dead horse by replying to this thread with
> things that do nobody any good. It seems like there are a lot better
> way to waste time, though.
>
> The Python/C API can get me back further without reliance on third-
> party libraries than ctypes. It also isn't subject to the quirks that
> ctypes is on platforms other than Windows (the target application runs
> on Windows, Mac, and eventually Linux once the original distributor
> has drivers for the device). I'm not even sure ctypes could load the
> lib/driver the distributor packaged.
>
Ctypes works fine on many platforms. Since you didn't even know about
ctypes until you were told about it, don't you think it's a little
premature to be speculating about problems you haven't actually
experienced?

> So really, I appreciate the option in ctypes, it's good stuff. But
> it's not for this project.
>

It's actually perfectly suited, but you're (I'm assuming) and adult
and can make your own decisions...

> Once again, the original question stands for anyone who has experience
> with the Python/C API callbacks.
> --

If you know how to write a callback in C, you know how to do it with
Python/C. It's not real flexible if the callback API you're using
doesn't include user data, and it looks like it doesn't.

Ctypes can generate dynamic thunks and therefore will let you use any
Python object as a callback. It's a lot more flexible and it's a lot
easier to not write your own thunk generation in C.



More information about the Python-list mailing list