How to pass an array in Python using a C ++ program?

I run two programs: one in Python and one in C ++, and I need to split a two-dimensional array (total decimal numbers) between them. I am currently studying serialization, but pickleunfortunately it is specific to python. What is the best way to do this?

thank

Edit: It is likely that there will be only 50 elements or so in the array, but data transfer will be required very often: 60 times per second or more.

+3
source share
7 answers

I suggest google protobuf

+6
source

boost::python, .

pickle boost::python .

+4

, , .

( ) .

+3

PyUblas, Numpy Boost.Ublas Boost.Python. .

+3

? , JSON . ++, Python JSON 2.6. . http://www.json.org/.

+1

c- ( ctypes python) /

+1

- , IPC - . IPC? (, , mmap ..)

- ( ) , struct. C, , ( , !). ++ .

Python script ++, .

+1

Source: https://habr.com/ru/post/1748389/


All Articles