Home

Awesome

Boost Python Examples



C++ Boost Python

Boost Installation with python3 support
Demo
python3 hello_ext
git clone https://github.com/zpoint/Boost-Python-Examples.git
cd Boost-Python-Examples/Examples/hello_ext
make

python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import hello_ext
>>> hello_ext.greet()
'hello, world'
python2 hello_ext
git clone https://github.com/zpoint/Boost-Python-Examples.git
cd Boost-Python-Examples/Examples/hello_ext
vim makefile # change the first line "PYTHON_VERSION = None" to "PYTHON_VERSION = 2.7"
make

python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import hello_ext
>>> hello_ext.greet()
'hello, world'