This is a extended python2/3 compatible version of physacco's hello world example. The original work was done by physacco in gist.
You can use the convenient script...
$ ./build.sh
Or run the command by yourself
$ pythonX.Y setup.py build
$ cd build/lib...-X.Y
$ pythonX.Y
>>> import hello
>>> hello.hello_world()
Hello, world!
>>> hello.handle_int(1234)
1234
>>> hello.handle_python2_str('あ')
b'\xe3\x81\x82'