Simple IPC between C++ and Python (cross platform)

前端 未结 7 1057
梦谈多话
梦谈多话 2020-12-02 07:50

I have a C++ process running in the background that will be generating \'events\' infrequently that a Python process running on the same box will need to pick up.

7条回答
  •  爱一瞬间的悲伤
    2020-12-02 08:47

    I will say you create a DLL that will manage the communication between the two. The python will load DLL and call method like getData() and the DLL will in turn communicate with process and get the data. That should not be hard. Also you can use XML file or SQLite database or any database to query data. The daemon will update DB and Python will keep querying. There might be a filed for indicating if the data in DB is already updated by daemon and then Python will query. Of course it depends on performance and accuracy factors!

提交回复
热议问题