【问题标题】:How to call functions inside a DLL file in python?如何在python中调用DLL文件中的函数?
【发布时间】:2020-08-15 19:47:45
【问题描述】:

我目前正在开发一个使用 C# 中 DLL 中的函数的 python 项目。我正在尝试使用 ctypes 模块,但出现错误:

OSError: [WinError 193] %1 is not a valid Win32 application

给我带来问题的代码是这样的:

DLL = ctypes.CDLL("c:\\Users\\Hunter1300FC\\Desktop\\MyDLL\\WeAreDevs_API-cpp.dll")

我正在使用 python 3.8.5 64 位。

【问题讨论】:

    标签: python python-3.x dll ctypes


    【解决方案1】:

    您的 DLL 文件很可能是以 32 位编译的。加载 64 位 DLL 或尝试使用 32 位 python。您可以使用 miniconda 轻松安装 32 位 python。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-17
      • 1970-01-01
      • 1970-01-01
      • 2023-03-03
      • 2022-08-03
      • 1970-01-01
      相关资源
      最近更新 更多