繁体   English   中英

如何在 python 中的 DLL 文件中调用函数?

[英]How to call functions inside a DLL file in python?

我目前正在开发一个 python 项目,该项目使用 C# 中的 DLL 中的函数。 我正在尝试使用 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 位。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM