Passing a packed C structure to a c module

"Martin v. Löwis" martin at v.loewis.de
Fri Apr 14 12:18:43 EDT 2006


Philippe Martin wrote:
> Is it possible to define a packed C structure in python and pass it to the c
> module, or should the wrapper do that ?

You can create a packed structure using string concatenation, and with
the help of the struct module. However, this gives you a string object
in the end, which you still need to pass into your C library.

It is better to fill the struct in the wrapper.

Regards,
Martin



More information about the Python-list mailing list