Interfacing a running C/Cuda program and a python service

Hello everyone,
this may be a little off topic, but i need to do the following:
I have a C/Cuda prog and a python service that start separatly

Then the python needs to be able to communicate with the C/Cuda prog to initiate a function to load things into memory
Then a undefined time later the python will need to call a C++ function sending it an Array which uses what the first function loaded into memory to do a comparison, and then return an array

Im not sure what the best way would be to do that.
I was either thinking about doing it over a socket or maybe even writing all the code into python… but i havent checked out how to do that.

any suggestions welcome


There’s a CUDA wrapper for Python called PyCuda:

I don’t really use Python so I can’t tell you how helpful that will be.