I am trying to do a "Hello World" program in Cython, following this tutorial http://docs.cython.org/src/tutorial/cython_tutorial.html#cython-hello-world
I c
If you are using a setup.py with Extension, as in this example
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
ext_modules = [
Extension("mymodule1", ["mymodule1.py"]),
Extension("mymodule2", ["mymodule2.py"]),
]
setup(
name = 'My Program Name',
cmdclass = {'build_ext': build_ext},
ext_modules = ext_modules
)
then you have to add the following snippet to apply the language_level directive (BEFORE the setup(...), thanks codeman48):
for e in ext_modules:
e.cython_directives = {'language_level': "3"} #all are Python-3