Writing 'C' structures out in cPickle format?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chance Ginger

    Writing 'C' structures out in cPickle format?

    I have a problem that I am trying to solve. I have two different
    systems - one written in C and another in Python. I would like the
    two to exchange some information.

    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).
  • Diez B. Roggisch

    #2
    Re: Writing 'C' structures out in cPickle format?

    > On the Python side I decided to use cPickle. On the C side I would[color=blue]
    > 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).[/color]

    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

    Comment

    Working...