[Pyrex] return pointer to a struct

Greg Ewing greg.ewing at canterbury.ac.nz
Fri May 29 02:44:34 CEST 2009


horace wrote:

> i have a c library with a function which returns a pointer to a struct. 
> this struct should be exposed to python. it should be possible to modify 
> the variables of this struct from python and the c library should see 
> those changes.

Create an extension type that wraps your C pointer, and
give it appropriate methods or properties for accessing
the fields.

-- 
Greg



More information about the Pyrex mailing list