close
The Wayback Machine - https://web.archive.org/web/20230306003506/https://github.com/bast/pybind11-demo
Skip to content

bast/pybind11-demo

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
September 3, 2017 11:47
September 3, 2017 11:25
September 3, 2017 11:38
September 3, 2017 11:24
September 3, 2017 11:44
September 3, 2017 11:48

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published