##hw.py
#coding:gbk
def hi():
print "hello the cython"
#setup.py
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
setup(
cmdclass = {'build_ext':build_ext},
ext_modules = [Extension("hw",["hw.py"])]
)
構建使用命令 python setup.py build_ext --inplace