How does a C API-function returns a list to python

YarLevub yarlevub at aol.com
Sun Jan 12 22:52:04 CET 2003


>YarLevub wrote:
>> The simplest way is to return a string containing the data and then use the
>> array module to make it available to your Python program.
>
>Do people really do such things?
>
>Regards,
>Martin

I do it to keep from having to write as much C code as you showed in your
response to the OP.

Of course, your solution has the advantage that users of the module don't need
to deal with the underlying binary representation of the data.

In my case I am the user and I tend to wrap the low level up with either a
class or function in Python.  I would rather keep my C code really simple
because it is harder to debug than Python.

Ray




More information about the Python-list mailing list