What is the simplest and most productive approach for prototyping Python bindings for existing C / C ++ libraries?

I want to create simple prototype Python bindings to evaluate various C / C ++ libraries.

I need to experiment with Linux, Windows and Mac.

Some examples of libs that I need bindings for include a combination of C or C ++ libraries, such as:

There are several candidates such as swig, ctypes, Boost.Python, pybindgen and questions have already been posted here on this topic, although the focus is on performance. Python extension - to swig, not for swig or cython

I like getting something simple and quick rather than about performance.

What would you recommend for quickly creating bindings?

+4
source share
2 answers

ctypes fits the bill pretty well for C. It's funny to easily make thin wrappers around C libraries with it.

+4
source

Did you consider Cython ? It allows you to link static libraries and write bindings in a language that looks like python.

+4
source

Source: https://habr.com/ru/post/1345926/


All Articles