我正在使用:
from distutils.core import setup
from Cython.Build import cythonize
setup(ext_modules = cythonize("myfile.pyx"))
Run Code Online (Sandbox Code Playgroud)
编译myfile.pyx。有没有办法:
.pyd当前文件夹(而不是build/子文件夹)build/子文件夹,删除.c文件)不用自己做os.remove(...)吗?
您可以使用以下--inplace选项:
--inplace (-i) ignore build-lib and put compiled extensions into the
source directory alongside your pure Python modules
Run Code Online (Sandbox Code Playgroud)
setup.py clean应该清理构建目录。setup.py clean --all清除所有构建输出。