有没有可能/如何获得在python上运行pythran生成的c++代码

2024-05-16 18:17:15 发布

您现在位置:Python中文网/ 问答频道 /正文

Pythran is a Python-to-C++ compiler for a subset of Python that includes partial numpy support. It acts a little like Numba and Cython—you annotate a function’s arguments, and then it takes over with further type annotation and code specialization. It takes advantage of vectorization possibilities and of OpenMP-based parallelization possibilities.

在一些例子中,我展示了如何从python内部使用它来优化它,但是我想知道是否有可能使用它将python代码翻译成c++。。。你知道吗

它能做到吗? 如果我想使用的函数依赖于另一个呢? 如果其他函数是从单独的模块导入的呢? 有这样一个过程的例子/教程吗?你知道吗


Tags: andofto函数forthatcompileris