So I have 2 processing units, one runs on Python and the other runs of C++. The first one will generate a set of data of around 3 - 5 values, either as a list of ints or a string. I want this value to be passed to C++, what is the best method? Like do I have to create a file in python then load it in C++? or there are an another way? This process would repeat every second, so I wish the transmission to be fast enough.
Asked
Active
Viewed 79 times
0
-
I'd use a TCP/UDP socket cos it's easy to port to other OSes. – Adrian May Oct 15 '14 at 10:03
-
Use some serialization library such as protobuf. – Nipun Talukdar Oct 15 '14 at 10:04
-
2I think communication by files could be a good first solution. For faster results, using communication by socket is a solution, but more difficult to implement and debug. – Caduchon Oct 15 '14 at 10:07
-
Another option is to use a named pipe. – PM 2Ring Oct 15 '14 at 11:16
-
protobuf is great for situations with limited network throughput (high serialization costs, small result). Not what one would use if two programs are running on the same machine. – MaxNoe Nov 19 '15 at 23:58
1 Answers
0
I'd suggest using python's struct to pack your values in python which could be viewed as a 'struct' in c++, then send it from python to c++ using zeromq.

ZFY
- 135
- 12