How to pretty-print ctypes composite data types?

G

Grant Edwards

I'm using ctypes with a library that requires a handful of structure
definitions. The actual definitions and usage aren't a problem. When
it comes time to print out the values in a structure or array, there
doesn't seem to be simple/general way to do that. Am I missing
something?

I presume one can recursively iterate through the fields in a
structure and elements in an array, recursing on any composite types
and printing the values when one finds a type, but I'm surprised
that's not something that's already in the ctypes library somewhere --
the authors certainly seem to have thought of everything else.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top