I would like to hear how a real Python/JupyterLab developer would solve the problem of exchanging data to and from a c++ Windows application. Se my other post: https://discourse.jupyter.org/t/embedding-jupyterlite-in-a-windows-application/25186?u=cpede
I want to be able to read data from my Windows application, then do different post-processing in Python/JupyterLab, and the optionally return some data back to my Windows application.
What would be the preferred way?
Thanks cpede
I don’t really know the limitations or capabilities in a Windows system, but in general (afaik) there three ways of doing it (ie, exchange data between Python and C or C++):
-
through a message broker/queue system
- ZeroMQ seems to be the common choice.
-
read/write to a shared memory space or buffer.
- See CPython’s multiprocessing: multiprocessing.shared_memory — Shared memory for direct access across processes — Python 3.12.3 documentation.
- See CPython’s struct: struct — Interpret bytes as packed binary data — Python 3.12.3 documentation
-
send/receive data through a socket
- See Google’s protobuf: https://protobuf.dev/
Also, the following pages may help you:
1 Like