Python get data from C++

Hy all,

I am in learning with python in blender and my custom controller

is possible to share data value between python and C++ in real time
in this case i use memory not socket , so python can get sensor data accuratelly

Perhaps you can use CTypes.


import ctypes
msg = ctypes.windll.user32.MessageBoxW
msg(None, "Hello", "Hello From Blender", 0)

This code uses DLL only, but you can instantiate C structures (or objects) as well that will be hosted by the Python application, with the rest C functions you can modify the data.
here. http://www.sagemath.org/doc/numerical_sage/ctypes_examples.html

However this is the only dependency, that you will have to let Python host the application. But otherwise, for more dynamic and independent functionality (i.e. everything works like the way is supposed to) using sockets is far better.