How to pickle a C struct?

Michael Husmann Michael.Husmann at teleatlas.com
Tue Feb 13 04:17:20 EST 2001


I have SWIG(ed) a C library with lots of structs and wanted
to use the shelve module to store some data on harddisk.
Those data contains a simple C struct.
I have read that I have to add the two functions
__getstate__() and __setstate__() in addmethods for storing
and retrieving. 

Is there someone who has done so to give me an example.

Michael



More information about the Python-list mailing list