I want to implement a system which consists of a Python UI and some Rust datastore and functions. The user executes the python code which in turn executes the Rust program in a subprocess. I want the Rust program to run in the background, waiting to exchange variables or function calls with the Python UI (for example every time a button is pressed).
My obstacles are:
I have tried to make a simple Rust FFI library that can be invoked with ctypes from Python but I don't know how this library will be able to communicate with the compiled rust program that is running on the background.
Another approach is to use PyO3 to make a python module using rust. But again I cannot understand how this will cooperate with the rust program to exchange data