calling python functions from c

Eric Brunel eric.brunel at N0SP4M.com
Mon Nov 24 04:22:10 EST 2003


wesley henwood wrote:
> The documentation for doing this can be found at:
> http://www.python.org/doc/current/ext/callingPython.html
> 
> The only part I can't get is how to pass a pythong function object to a 
> c function.  How does one do this?

I'm not sure I understand the question, since the document you give above *does* 
have a Python function passed to a C function. If you wonder what type to set 
for Python callbacks, it's just PyObject*: in Python, functions are just objects 
like every other ones, so they have the same C type.

HTH
-- 
- Eric Brunel <eric dot brunel at pragmadev dot com> -
PragmaDev : Real Time Software Development Tools - http://www.pragmadev.com





More information about the Python-list mailing list