Pybind11 Demo Save

Demonstrates how to call a C++ class from Python using pybind11.

Project README

Build Status License

pybind11 demo

Demonstrates how to call a C++ class from Python using pybind11.

Tested on Linux and Mac: https://travis-ci.org/bast/pybind11-demo/builds

How to build this demo

git clone --recursive https://github.com/bast/pybind11-demo.git
cd pybind11-demo
mkdir build
cd build
cmake ..
make

Example test run

>>> from example import add
>>> add(2, 3)
5
>>> from example import Pet
>>> my_dog = Pet('Pluto', 5)
>>> my_dog.get_name()
'Pluto'
>>> my_dog.get_hunger()
5
>>> my_dog.go_for_a_walk()
>>> my_dog.get_hunger()
6
Open Source Agenda is not affiliated with "Pybind11 Demo" Project. README Source: bast/pybind11-demo
Stars
32
Open Issues
1
Last Commit
3 years ago
Repository

Open Source Agenda Badge

Open Source Agenda Rating