Skip to content
Snippets Groups Projects
_hello_python.cc 297 B
Newer Older
#include <pybind11/pybind11.h>

Xuefeng Ding's avatar
Xuefeng Ding committed
#include "complexf.h"
#include "hello.h"
Xuefeng Ding's avatar
Xuefeng Ding committed
PYBIND11_MODULE(_hello, m) {
Xuefeng Ding's avatar
Xuefeng Ding committed
  m.doc() = "pybind11 example plugin";  // optional module docstring

  m.def("add", &add, "A function which adds two numbers");
Xuefeng Ding's avatar
Xuefeng Ding committed
  m.def("complexf", &complexf, "complex(a,b) = add(a,b) + 2");
Xuefeng Ding's avatar
Xuefeng Ding committed
}