Cython setup.py for several .pyx

后端 未结 2 1170
温柔的废话
温柔的废话 2020-12-15 18:20

I would like to cythonize faster. Code for one .pyx is

from distutils.core import setup
from Cython.Build import cythonize

setup(
    ext_modules = cythoniz         


        
2条回答
  •  爱一瞬间的悲伤
    2020-12-15 19:11

    The answer above wasn't completely clear to me. To cythonize two files in different directories, simply list them inside of the cythonize(...) function:

    from distutils.core import setup
    from Cython.Build import cythonize
    
    setup(
        ext_modules = cythonize(["folder1/file1.pyx", "folder2/file2.pyx"])
    )
    

提交回复
热议问题