passing callback function to c-extension

Diez B. Roggisch deets_noospaam at web.de
Wed Jan 14 11:45:08 EST 2004


Hi,

> A Python function is just a regular Python object, so it is represented at
> C level by a PyObject*. To call it from C, just use one of the
> PyObject_Call functions - see
> http://www.python.org/doc/current/api/object.html#l2h-189

Thanks - works like a charm. I'm now looking for a way to ensure that the
passed object is actually a callable one - and how to throw exceptions. But
I just started looking for that, so I'll be back if I really need help.

Diez



More information about the Python-list mailing list