Notes:
- Everything in the Python header (
Python.h
) starts with the prefixPy
ofPY
. - The
PyObject
type is always used as a pointer to handle all the data parsing betweenPython
andC
. - If the
C
function returns nothing, return thePy_None
value which is equivalent to theNone
value inPython
. - Build the moudule using:
python setup.py build
- Copy the built file (module.so) from
build/lib*/
folder to where you want to keep it, like otherPython
scripts (script.py).