Extending python

John john.thai at dspfactory.com
Wed May 23 12:18:55 EDT 2001


Hi,

    Are there any docs which provide examples on how to extend python with
C/C++ other than the one at www.python.org??  I don't seem to understand how
to use PyObject *.  If I pass a list or tuple to my C function, and in my
function I extract the list or tuple using "O" as a format specifier in a
call to PyArg_ParseTuple, how do I actually get the integers or strings from
the PyObject???  What I'm trying to do is pass a variable number of data to
my C function through an array.  So is it proper to pass a list/tuple to my
C wrapper function and extract the elements into a dynamic array, which I
then pass to my C function?  Please advise...

Thanks,

John





More information about the Python-list mailing list