2024-10-04 05:30:55 发布
网友
def HelloWord(): print('hello word')
from calaTools.toolsTep import * #pythran export callOtherPyFiles() def callOtherPyFiles(): HelloWord()
None:None error: Module 'calaTools.toolsTep' not found.
在分发带有Pythran模块的Python应用程序时,您可以:
将该模块声明为常规Python模块。毕竟,它们是100%Python兼容的
将它们声明为PythranExtension,Pythran将编译它们:
从distutils.core导入设置
这两行需要能够在setup.py中使用pythran 导入设置工具 setuptools.dist.Distribution(dict(setup\u需要class='pythran'))
从pythran.dist导入PythranExtension,PythranBuildExt 设置(。。。, ext_modules=[PythranExtension(“mymodule”,“mymodule.py”]), cmdclass={“build_ext”:PythranBuildExt}) PythRANBuffDeXT是可选的,但需要用不同的C++编译器构建扩展。默认情况下,它派生自distuil的build_ext,但您可以改为使用PythranBuildExt[base_cls]来更改其基类
.pythranrc中支持的所有配置选项也可以通过可选的config参数以列表的形式传递,例如config=['compiler.blas=openblas']
来自pythran博士。https://pythran.readthedocs.io/en/latest/MANUAL.html
在分发带有Pythran模块的Python应用程序时,您可以:
将该模块声明为常规Python模块。毕竟,它们是100%Python兼容的
将它们声明为PythranExtension,Pythran将编译它们:
从distutils.core导入设置
这两行需要能够在setup.py中使用pythran 导入设置工具 setuptools.dist.Distribution(dict(setup\u需要class='pythran'))
从pythran.dist导入PythranExtension,PythranBuildExt 设置(。。。, ext_modules=[PythranExtension(“mymodule”,“mymodule.py”]), cmdclass={“build_ext”:PythranBuildExt}) PythRANBuffDeXT是可选的,但需要用不同的C++编译器构建扩展。默认情况下,它派生自distuil的build_ext,但您可以改为使用PythranBuildExt[base_cls]来更改其基类
.pythranrc中支持的所有配置选项也可以通过可选的config参数以列表的形式传递,例如config=['compiler.blas=openblas']
来自pythran博士。https://pythran.readthedocs.io/en/latest/MANUAL.html
相关问题 更多 >
编程相关推荐