/python-to-cxx-bindings

A simple demostration project for python to C++ bindings

Primary LanguageC++

Python binding to C++ sample project using pybind11

  • src/: The sources of a very simple library with a parent class Animal and children classes Dog and Cat. The output of calling make in this folder will be the static library libanimal.a.
  • bindgins/: wrapper.cc contains the code used by pybind11 to generate the the dynamic library.

How to

cd src
make
cd ../bindings
make
python
>>> import animal
>>> snoopy = animal.Dog('Snoopy')
>>> snoopy.talk()
waf!

Process

process graph