Please view Cython . This makes porting C easy.
This is due to the documentation when calling external C functions :
cdef extern from "math.h": double sin(double) def pysin(x): return sin(x)
Then you can call pysin from the compiled module, just like a regular Python module.
source share