Python extension building with boost
- by user1544053
Hey guys I'm fairly new to boost c/c++ library. I downloaded boost library and build the library.
I created a very simple python library in c++ using boost interface (actually it is example code given in the documentation). I built it into a dll file. In the documentation it reads that this dll is exposed to python and they just show the import function in python and include the created library.
I don't understand how to expose that dll to python and load the library inside in tradition ('import') manner.
In case if you wanna look at the code then here it is:
#include <boost/python.hpp>
char const* greet()
{
return "hello, world";
}
BOOST_PYTHON_MODULE(hello_ext)
{
using namespace boost::python;
def("greet", greet);
}
Please help I really want to build applications with c/c++ and python.
I simply want to use hello_ext as:
>>>import hello_ext
>>>print hello_ext.greet()
Thank you.