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 created helloworld.pyx
print("Hello World")
and setup.py
:
from distutils.core import setup
from Cython.Build import cythonize
setup(
ext_modules = cythonize("helloworld.pyx")
)
How can I change setup.py to specify that my source is Python 3, rather than Python 2 like in the tutorial? If I invoke "cython" command from the command line, it accepts -3
option. But if I compile with python setup.py build_ext --inplace
like shown in the tutorial, how do I specify Python 3 source? It may not matter much for a Hello World program, but will matter as I start using Cython for real projects.