rocarvaj
7/28/2016 - 9:14 PM

How to use Cython

How to use Cython

  1. Create script my-script.pyx
  2. Create setup.py with
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext

ext_modules = [Extension("hello", ["hello.pyx"])]

setup(
  name = 'Hello world app',
  cmdclass = {'build_ext': build_ext},
  ext_modules = ext_modules
)
  1. Compile with python setup.py build_ext --inplace