【问题标题】:Add python function to c++ program [closed]将python函数添加到c ++程序[关闭]
【发布时间】:2014-05-17 22:18:57
【问题描述】:

如果我在c++中有一个程序,我可以在这个程序中添加我自己用Python编写的函数my_fun()吗?有任何简单的教程我该怎么做?我找到了一些关于 boost 和内置函数的建议,但我找不到如何添加自己的函数

【问题讨论】:

    标签: python c++ python-2.7


    【解决方案1】:

    Python 文档中有关于在 C++ 程序中嵌入 Python 的信息。 Here is the Python 2 version of the documentation 和 here is the Python 3 version

    在不知道 my_fun 是多么简单或复杂的情况下 - “非常高级的嵌入”可能足以满足您的需求。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-12-14
      • 1970-01-01
      • 2010-12-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多