Skip to content

Latest commit

 

History

History
37 lines (27 loc) · 843 Bytes

File metadata and controls

37 lines (27 loc) · 843 Bytes

Python 2/3 extension example

This is a extended python2/3 compatible version of physacco's hello world example. The original work was done by physacco in gist.

Build

You can use the convenient script...

$ ./build.sh

Or run the command by yourself

$ pythonX.Y setup.py build

Run

$ 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'

References