cython
A superset of python with c data types that compiles to c code
The c code it compiles to is long as fuck :(
Basic Setup
Name python file to compile
.pyx
In a
setup.py
,from distutils.core import setup from Cython.Build import cythonize setup( ext_modules = cythonize("<FILENAME>.pyx") )
Run this on the command line:
python setup.py build_ext --inplace
This creates a .so and .c file
To use this in python just
import test
Variables
cdef int n, i, len_p
Last updated