In breve, si scrive in Python usando tipi del linugaggio C.
È un gruppo di comandi aggiuntivi a Python
In realtà dopo aver creato il file .pyx si può procedere in diversi modi alternativi
Quando si vuole usare un tipo C nel linguaggio Python si deve usare la dichiarazione “cdef”
cython -a
Dopo aver copiato i seguenti file, si devono esegure due passaggi:
python setup.py build_ext --inplace
from hello import say_hello_to
import hello
def say_hello_to(name): print("Hello %s" % name)
from distutils.core import setup from cython.Build import cythomize setup( ext_modules = cythomize("hello.pyx") )