Exposing a C++ API to Python

前端 未结 5 1336
夕颜
夕颜 2020-12-07 14:20

I\'m currently working on a project were I had to wrap the C++ classes with Python to be able to script the program. So my specific experience also involved embedding the Py

5条回答
  •  醉酒成梦
    2020-12-07 14:50

    I suggest SIP. SIP is better than SWIG due to the following reasons:

    1. For a given set of files, swig generates more duplicate (overhead) code than SIP. SIP manages to generate less duplicate (overhead) code by using a library file which can be statically or dynamically linked. In other words SIP has better scalability.

    2. Execution time of SIP is much less than that of SWIG. Refer Python Wrapper Tools: A Performance Study. Unfortunately link appears broken. I have a personal copy which can be shared on request.

提交回复
热议问题