1

I have a C++ API. The API uses Google protobuf to receive message. Now I want to wrap C++ API to python. In python code, I will create protobuf message (same proto file as C++ API) and call C++ API to send. I am using Python SIP to wrap C++ API. But I don't known how to from python call C++ API method with an argument is protobuf message.

Can you help me?.

Do Ngoc Tuan
  • 33
  • 1
  • 9
  • https://stackoverflow.com/questions/145270/calling-c-c-from-python – ZiTAL Dec 12 '17 at 09:28
  • So, your C++ API is used for sending or receiving the Protobuf messages (provide at least some API functions signatures)? Furthermore, you cannot just pass Python Protobuf.Message object to C++ function, because it expects C++ Protobuf::Message (as far as I got from your description). Describe your problem, because it looks like [XY problem](https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem) – pptaszni Dec 12 '17 at 10:43
  • thank you for your help. Python sip can binding for protobuf message. I solved this problem and have a simple example code: https://github.com/tuanakka0101/python-sip-example – Do Ngoc Tuan Dec 13 '17 at 02:24

0 Answers0