【问题标题】:How can I use Python.h file to make python C extensions如何使用 Python.h 文件制作 python C 扩展
【发布时间】:2019-11-17 12:20:53
【问题描述】:

我想为 python 做 c 扩展。我知道 C 的基础知识,并且由于性能更好,我想进行扩展。我不太了解 Visual Studio 和 C。所以请体谅。

我搜索了很多,但没有找到任何可行的解决方案。当我试图 #include <Python.h> 文件,它说它找不到它。我该怎么办?

【问题讨论】:

  • 在您的计算机上找到 Python.h,然后将其目录添加到您的包含搜索路径中。
  • 我在 python\include 中有一个 Python.h 文件。他们是一样的吗?我尝试将 python\include 添加到我的包含搜索路径

标签: python c visual-studio extension-methods


【解决方案1】:

MS 有一个文档专门针对您的具体情况,并附有分步说明:Write C++ extensions for Python - Visual Studio | Microsoft Docs

简而言之,你

请注意,没有与 distutils、pytest、tox 等进一步集成。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-05
    • 1970-01-01
    • 2010-11-14
    • 2015-04-07
    • 2021-04-02
    • 2010-11-07
    相关资源
    最近更新 更多