ipybind
ipybind copied to clipboard
How to build?
Hi, how can I build this package to try the notebook example? Thanks
- in
ipybind-master
runjupyter lab
orjupyter notebook
- just include pybind11 path
import ipybind
%load_ext ipybind
%pybind11_capture
%pybind11_capture
%pybind11_capture on
%pybind11_capture off
%pybind11_capture 1
%pybind11_capture 0
%%pybind11 -f -I="your_path_to_pybind11/include/";
PYBIND11_PLUGIN(test) {
py::module m("test");
m.attr("x") = py::cast(1);
m.attr("_y") = py::cast(2);
m.attr("__z") = py::cast(3);
m.def("add", [](int x, int y){return x + y ;});
return m.ptr();
}
add(3,456)