Data Exchange Between Python and C++ via protobuf

Installing protobuf The first step is of course installing the protobuf library. I used homebrew for the main library and pip to install the Python modules: brew install protobuf pip install protobuf Then I defined a very simple data structure using the proto-syntax: // Filename: foo.proto package prototest; message Foo { required int32 id = 1; required string bar = 2; optional string baz = 3; } This proto-file can now be translated into C++ and Python classes via:...

March 22, 2014 · 2 min · Tamás Gál