如何将 pascal dll 连接到 python?

How to connect pascal dll to python?

我在 pascal dll 中有一些函数。我需要在我的 python 代码中使用这个函数。我该怎么做?

unit LwdCalcIntSLB;

interface

const
  Err_UnknownError=-1;
  Err_InvPallet=-2;
  Err_InvPalletFile=-3;
  Err_CntCreatePalletFile=-4;

function ExpPrepareDataLWDinit(wPath: PAnsiChar;                                 
     wBS, wDFD,                                                              
     wDDEV, wDTOOL: single): HResult; stdcall; external   'LwdCalcSLB.dll';  

function ExpFreeDataLWD: HRESULT; stdcall; external            'LwdCalcSLB.dll';

function ExpCalcWinkNormLWD (wRAT: single;                                       
     var wWINK: single): HRESULT; stdcall; external        'LwdCalcSLB.dll'; 

function ExpCalcRhobLWD (wRHOB: array of single;                                 
     var wRHU, wRHD: single): HRESULT; stdcall; external   'LwdCalcSLB.dll'; 

implementation


end.

我试过 ise ctypes 库,但这不是个好主意

Stdcall、dll 和 HResult 都是 windows 相关的,包括(使用)单元 Windows。