Pickle for C++?

Warren Postma embed at NOSPAM.geocities.com
Wed Jun 28 12:29:53 EDT 2000


"Thomas Thiele" <thiele at muc.das-werk.de> wrote in message
news:395A1F7E.4112B2A3 at muc.das-werk.de...
> Hi!
>
> I have a Python class that holds a lot of data.
> And I now want to send these datas over a TCP - connection via
> pickle and sockets. It works fine. But now I want
> that an application written in C++ is able to unpickle the data-class
> too and write it's content into an equivalent C++ - class/struct.
>
> Is there any solution out there or have I to write my own C++ - pickle
> algorithm?

Embed Python into your C++ application, and don't bother trying to tie a
static language to a dynamic one by making a set of fixed C strucutres.
Believe me it's a waste of time.

You can embed the Python DLL or shared library into your C++ application in
a matter of minutes, and then unpacking your data will be a single line call
to a Python function that will unpack your structure and a simple set of
functions to get and set the data in your python objects.

Warren





More information about the Python-list mailing list