Re: Function References



squishywaffle@xxxxxxxxx wrote:

Hello Diez.

May I suggest you move to ctypes for wrapping? It's easier, pure python
and callbacks are already built-in.

I'm pretty new to extending Python in C, I don't understand what
you're saying. Are there any examples or a brief explanation/URL you
could point me to?

Is google dead today?

http://www.google.com/search?q=python+ctypes&ie=UTF-8&oe=UTF-8

First hit.

Ctypes is a since python2.5 built-in module that allows to declare
interfaces to C-libraries in pure python. You declare datatypes and
function prototypes, load a DLL/SO and then happily work with it. No C, no
compiler, no refcounts, no nothing.

And you can pass python-functions as callbacks.

See the module docs for examples.

Diez
.



Relevant Pages

  • Re: Best IDE for Python
    ... The best general-purpose IDE for Python, IMO, is WingIDE. ... including code completion, syntax highlighting, a built-in Python ... I don't think it has any features built-in specifically for ...
    (comp.lang.python)
  • Re: returning a value from a thread
    ... > I thought the GIL was supposed to take care of that. ... Python level subclasses). ... pair into a built-in dictionary is atomic with respect to the Python ... thread objects may be using a mutable container object ...
    (comp.lang.python)
  • Solutions for data storage?
    ... I'm writing a relatively simple multi-user public Web application with ... (not particularly clean code, either). ... places, built-in indexing, built-in features for handling schema ... I'm wondering if there are any Python data storage ...
    (comp.lang.python)
  • Re: python timers and COM/directshow
    ... video position with a timer. ... You'd help your cause a lot here if you posted *Python* ... they tend to vary as to how they arrange their callbacks. ... def handle_lbutton_click: ...
    (comp.lang.python)
  • Bus error in PyGILState_Release (callbacks from other threads)
    ... I'm trying to write an extension in C that delivers callbacks to ... threads that is started to be able to deliver callbacks to Python. ... cdef extern from "Python.h": ...
    (comp.lang.python)