Writing 'C' structures out in cPickle format?

Diez B. Roggisch deets at nospam.web.de
Tue Mar 14 10:12:12 EST 2006


> On the Python side I decided to use cPickle. On the C side I would
> write a library that can read the cPickle and generate the correct
> C structure (the data is, more or less, self-describing) and visa
> versa.
> 
> I was wondering if anyone has done something like this before
> and if so can they point me to information on how to easily do it?
> The structures I am using on the C side are pretty simple (very
> flat and using only integers and strings).

I guess it might be the more sensible choice to use module struct and
transform your python-data to C-structs. The reason is simply that to teach
the old dog C new tricks (namely react flexible on cPickle) is a hard task,
whereas customizing python objects serialization is comparably easy.

Diez



More information about the Python-list mailing list