Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Writing 'C' structures out in cPickle format?

Reply
Thread Tools

Writing 'C' structures out in cPickle format?

 
 
Chance Ginger
Guest
Posts: n/a
 
      03-14-2006
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).
 
Reply With Quote
 
 
 
 
Diez B. Roggisch
Guest
Posts: n/a
 
      03-14-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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
writing large dictionaries to file using cPickle perfreem@gmail.com Python 11 04-26-2009 09:12 PM
writing vector of structures to a file uche C++ 6 04-04-2007 10:00 AM
problem reading/writing structures from and to files arne.muller@gmail.com C Programming 6 10-08-2006 11:39 PM
structures, structures and more structures (questions about nestedstructures) Alfonso Morra C Programming 11 09-24-2005 07:42 PM
Type Casting IPv4 and IPv6 structures to Generic Structures tweak C Programming 14 06-11-2004 02:43 PM



Advertisments