[ctypes-users] accessing a C struct
Brought to you by:
theller
From: Jim V. <Jim...@no...> - 2003-02-25 22:56:02
|
Hello, I am just starting to use the ctypes module. A function in a dll, being accessed via ctypes, returns the address of a C structure. How can I use this address, from Python, to access fields in the structure? Do I define a ctypes Structure for the C structure? If so, how do I set the return type of the C function to be this ctypes Structure? The reason I'm asking rather than trying it is that the C structure is quite complex (contains nested structures and unions) and so will require alot of time to specify as a ctypes Structure -- especially if that is the wrong approach. Thanks. -- jv |