Exposing a C++ API to Python

前端 未结 5 1332
夕颜
夕颜 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:46

    A big plus for Boost::Python is that it allows for tab completion in the ipython shell: You import a C++ class, exposed by Boost directly, or you subclass it, and from then on, it really behaves like a pure Python class.

    The downside: It takes so long to install and use Boost that all the Tab-completion time-saving won't ever amortize ;-(

    So I prefer Swig: No bells and whistles, but works reliably after a short introductory example.

提交回复
热议问题