1. 编写py文件
def say_hello():
print("hello_world")
2. 编写setup.py文件,注意文件名需要改
from distutils.core import setup
from Cython.Build import cythonize
setup(ext_modules = cythonize(["hello.py"]))
3. 运行文件编译
python3 setup.py build_ext --inplace
4. 删掉py文件以后可以直接import