一、创建一个要打包的py文件 test.py 代码如下: name = 'test' def test(): print('hello world!') 二、新建一个用来打包的py文件 packer.py 代码如下: import distutils.core from Cython.Build import cythonize file