I'm curious what the most flexible, most efficient, and most seamless method is for getting C++ and Python to talk to each other. The contenders seem to be Pybind11, Boost.Python, and neither (simply writing functions and wrappers as below).
using namespace boost::algorithm;
static PyObject* strtest(PyObject* self, PyObject* args)
{
std::string s = "Boost C++ Libraries";
to_upper(s);
PyObject * python_val = Py_BuildValue("s", s.c_str());
return python_val;
}
PyMODINIT_FUNC initmath_demo(void)
{
static PyMethodDef methods[] = {
"Test boost libraries" },
{ NULL, NULL, 0, NULL }
};
PyObject *m = Py_InitModule("math_demo", methods);
}