Suggestions for wrapping C++ code for use with Python3
I am looking for suggestions for the preferred tool for wrapping C++ code so that it can be called from Python3. I have a very large C++ library and I would like to expose some parts of it to Python 3 for rapid prototyping purposes. I've looked into boost.python and Cython and I know there are others, but I have no experience to guide me.
I also don't know what tool is used to prepare the Python wrappers for Qt; I would like to check that out.
Finally, in my ideal universe, all I would have to do is to point some tool at a directory and say, "expose every class and every public method of those classes to Python" and voila, there it is. :cool:
Any suggestions (along with rationale) would be appreciated.
Re: Suggestions for wrapping C++ code for use with Python3
I see that Qt uses the Shiboken2 tool to create PySide Qt bindings. So I guess if it is good enough for Qt, I'll have to look into it.
Re: Suggestions for wrapping C++ code for use with Python3
You can check this https://www.qt.io/qt-for-python for used to prepare the Python wrappers for Qt and how do you use Qt Creator in Python: Open Qt Creator and go to Tools->Options->Environment->External Tools . Click Add->Add category and create a new category (for example, Python ). Then, select the created category and click Add->Add Tool to create a new tool - RunPy for example.
Re: Suggestions for wrapping C++ code for use with Python3
Thanks, but this shows how to set up Qt Creator for using the existing Pyside2 bindings and Python environment. My question was how to create my own bindings for my own Qt-based classes.
If you know of any automated tool for generating Python bindings from a C++ Qt class definition, I would like to know about that, not how to use Python inside of Qt Creator. From what I read of the Shiboken2 documentation, using it to generate bindings for anything except trivial classes would be a huge project. I have a library with hundreds of classes and a thousand or more functions. If I have to hand-code a typesystem file for Shiboken -and- keep that up-to-date with any changes I make on the C++ side, it would take me forever.