簡體   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