Extending python

David Humphrey dhumphrey at pdqdot.net
Wed May 23 14:44:43 EDT 2001


I've been doing quite a bit of this lately.  I'm working on WinNT 4.0 with
MS VC++ 6.0.  Once you get the hang of it, it really is quite simple, but I,
too, had a little trouble getting started.  I read the www.python.org docs.
I also read the appropriate sections in "Programming Python" by Mark Lutz as
well as "Python Essential Reference" by David Beazley.  Between the three,
I've been successful at making my C++ objects look like Python objects
although there are some subtle differences that I alluded to in a posting
"Operator overloading for part of an object" earlier today.

Regards,
David L. Humphrey
Manager, Software Development
Bell Geospace, Inc


"John" <john.thai at dspfactory.com> wrote in message
news:BpRO6.240623$Z2.2665674 at nnrp1.uunet.ca...
> 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