Here is a minimum working example of boos-python from the official web site.
First create a hello.cpp file and put this.
g++ -g -shared -fPIC -I/usr/include/python2.7 hello.cpp -lpython2.7 -lboost_python -o hello.so
Open IPython and import hello
now call hello.greet()
First create a hello.cpp file and put this.
Now compline .so file by doing the following.
Open IPython and import hello
now call hello.greet()