On 5/31/2016 1:16 AM, qshh...@alumni.sjtu.edu.cn wrote:
Hi Python experts,

I need to extend Python with C/C++ to interact with an in-house
legacy API. I'm implementing a data subscriber with Python, which
subscribes to a data publisher (actually a ZeroMQ publisher socket)
and will get notified once any new messages are fed. In my
subscriber, the messages are dumped to a data processor after
received. The subscriber will also get notified by the processor when
done. Since the data processor is written in C++, I have to extend
the Python code with a simple C++ module.

A couple of options you may not have considered. A. Run the C++ module in a subprocess. Pass data either in pipes or files. B. Compile the C++ module to a shared library and access via ctype module.

--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to