Python calls DLL questions

xiaoxiao2021-03-06  102

Sender: INSMNIA (Garfield), the letter area: Python Title: Python calls DLL questions ask the letter station: BBS Shuimu Tsinghua Station (Fri Aug 6 09:19:43 2004), transfer

Background: Python 2.3.3, CTypes 0.9.0, Matlab R14 Objective: To use Python as "adhesive" to combine the programs (* .m) of existing MATLABs through graphic GUI. Procedure: (for example) matlab function is as follows: function y = foo (x) y = x 1 then performs the following compile command mcc -w lib: foolib -lc -t -t link: lib foo.m generates the following batch file FOOLIB .C, FOOLIB.CTF, FOOLIB.DLL, FOOLIB.EXP, FOOLIB.EXPORTS, FOOLIB.H, FOOLIB.LIB, FOOLIB_MCC_COMPONENT_DATA.C Copies all of the above files into the Python directory, and the python command can be successfully executed as follows >> from ctypes Import * >>> cdll.foolib

But the following command failed >>> CDLL.FOOLIB (14) Traceback (MOST Recent Call Last): File "

", LINE 1, in -toplevel-

CDLL.FOOLIB (14)

AttributeError: CDLL Instance Has NO __CALL__METHOD

Question: How do I use the function in the DLL in Python? thank you very much!

-

※ Modification: · Insomnia in AUG 6 09:28:02 2004 Modified this article · [From: 218.1.160. *] ※ Modified: · INSMNIA in Aug 6 09:32:48 2004 Modified this article · [from: 218.1.160. *] ※ Modification: · INSMNIA in AUG 6 09:34:21 2004 Modified this article · [From: 218.1.160. *] ※ Source: · BBS Shuimu Tsinghua Station http://smth.org · [From: 218.110 *] *]

转载请注明原文地址:https://www.9cbs.com/read-124785.html

New Post(0)