from distutils.core import setup
from Cython.Build import cythonize
setup(
ext_modules = cythonize("helloworld.pyx")
)
all *.pyx files in a folder
from distutils.core import setup
from Cython.Build import cythonize
setup(
name = 'MyProject',
ext_modules = cythonize(["*.pyx"]),
)
#!/usr/bin/env bash
python setup.py build_ext --inplace
run it :
chmod +x build_pyx.sh
./buidd_pyx.sh
directly using pyximport
import pyximport; pyximport.install()
import helloworld
cdef int i, j, k
cdef float f, g[42], *h
cdef list foo = []
cdef (double, int) bar