I need to create Python bindings for a C++ library and after a brief survey of the available options was planning on using SWIG ( http://www.swig.org/tutorial.html ). How does this compare?
Cppyy – Automatic Python-C++ bindings
21–25 of 25 posts
Re: Cppyy – Automatic Python-C++ bindings
#22This is super interesting but if I am looking to bring C++ into my Python code base it would be because performance is important enough to do so. With that in mind I am not sure how this stacks up against compiled half steps like Cython or foreign function interfaces likes ctypes or CFFI instead.
If you have a Python code base and are looking to speed up some part of it, Cython is the way to go. Pybind11 and cppyy are more for cases where you have a bunch of C++ code that you want to provide a Python interface for.
Re: Cppyy – Automatic Python-C++ bindings
#23Re: Cppyy – Automatic Python-C++ bindings
#24Google PyInline
2001 vintage
Re: Cppyy – Automatic Python-C++ bindings
#25How does this compare to pybind11?
If you have a C++ project, you want to have Python bindings, and you don't want to share your header files, pybind11 is the way to go. If you want to / can share your header files, cppyy is a very convenient way of being able to call your C++ code from Python. I'm not sure if there is a way to use it without headers.