nathanlem1 / Cpp_Python_bindings

C++ Python bindings using two recursive algorithms, fibonnaci and factorial, as example.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C++ Python bindings

We implement two recursive algorithms, fibonnaci and factorial, in C++ and make Python bindings using pybind11, without even using CMake. We show here how we can use more than one C++ functions when we make Python bindings. The C++ functions are much faster than the Python implementations. We borrow some ideas from here.

We implement two recursive algorithms, fibonnaci and factorial, in C++ and make Python bindings using pybind11, without even using CMake. We show here how we can use more than one C++ functions when we make Python bindings. The C++ functions are much faster than the Python implementations. We borrow some ideas from here.

Dependencies

  • C++11
  • pybind11

pybind11 can be installed using:

pip install pybind11

Running Example Code

This module can be compiled and installed using:

pip install -e . -vvv

And you can run this module using:

python main.py

About

C++ Python bindings using two recursive algorithms, fibonnaci and factorial, as example.


Languages

Language:Python 70.8%Language:C++ 17.7%Language:C 11.5%