Writing 'C' structures out in cPickle format?

Discussion in 'Python' started by Chance Ginger, Mar 14, 2006.

  1. 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).
     
    Chance Ginger, Mar 14, 2006
    #1
    1. Advertising

  2. > 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
     
    Diez B. Roggisch, Mar 14, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tweak
    Replies:
    14
    Views:
    2,797
    Eric Sosman
    Jun 11, 2004
  2. Alfonso Morra
    Replies:
    11
    Views:
    733
    Emmanuel Delahaye
    Sep 24, 2005
  3. Ven
    Replies:
    6
    Views:
    525
  4. Alan
    Replies:
    3
    Views:
    760
    Roedy Green
    Oct 10, 2007
  5. Replies:
    11
    Views:
    842
Loading...

Share This Page