python - 有没有办法直接在 python (或 Ironpython)中导入 c *.lib 而不进行任何包装?

标签 python c ironpython .lib

如标题,有没有办法直接在python(或Ironpython)中导入c *.lib而不进行任何包装? (例如 *.dll 包括包装函数)

最佳答案

CPython 和 IronPython 都带有 ctypes module ,它允许您直接加载 DLL:

from ctypes import *

print hex(windll.kernel32.GetModuleHandleA(None))

请仔细阅读模块文档,它包含有关如何正确传递各种 C 类型的教程。

关于python - 有没有办法直接在 python (或 Ironpython)中导入 c *.lib 而不进行任何包装?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19628967/

相关文章:

jquery - 无法在 Bootstrap 中提交我的模态表单

python - Django 休息框架 : Embed Viewset Inside Viewset

python - GIS:在 Python 中合并多重多边形

c - C 中三重指针的用途

python - 如何使用 Winforms 在 IronPython 中画线?

c# - IronPython:从主机应用程序添加引用

python - 如何避免指数项的数值溢出错误?

c - 如何逐个字符地遍历字符串

ironpython - 在 Asp.Net 中使用 Ironpython 时 ExtensionAttribute 的引用不明确

c - 递增计数器时未使用表达式结果