Extending python with C

John Roth johnroth at ameritech.net
Fri May 18 12:12:28 EDT 2001


There's no such animal. The only reason to use an int * in
a C function is to modify the input variable as an output, and
you can't do (or at least shouldn't even think of doing)
that in the Python interface.

You need to pass your output back as a result variable. See
the documentation for the proper functions. Python allows
you to pass back complex structures, so you're not limited
the same way as C.

char * is valid, because that's actually the standard way C
handles passing a character string.

John H. Roth Jr.

"John" <john.thai at dspfactory.com> wrote in message
news:EQaN6.239271$Z2.2622445 at nnrp1.uunet.ca...
> Hi,
>
>     I am trying to building an C extension module.  How would I convert an
> Integer in Python to an int * in C ?  I know there's an "s" format
specifier
> for char *, but what about int *?
>
> Thanks,
>
> John
>
>





More information about the Python-list mailing list