我已经弄清楚如何在我的接口文件中使用import os
from easygui import *
#Sets Admin Credentials for every use
adminaccount = enterbox('Please enter you admin username:', 'Termination Requests')
adminpass = passwordbox('Please enter the password:', 'Termination Requests')
#Informs of steps to take, opens AD Users and Computers, and verifies steps taken for notes.
msgbox('Search AD for the User Accounts to be terminated, VPN Access, and PC Assignment.', 'Termination Requests')
os.system('"PsExec.exe \\127.0.0.1 -u Domain\%s -p %s -i dsa.msc')
ad = boolbox('Did the user have an AD Account?', 'Termination Requests')
处理标准类型(如int
)的指针参数。我仍然无法使用一个函数,该函数将一个结构数组的指针作为其参数。
我已经阅读了有关未绑定数组,结构和制作您自己的文字图的Swig 3.0文档,但文档还说在大多数情况下您不需要创建类型图。
如果我确实需要一个类型图,或者有另一种方法可以让下面的方法在python中运行,有人可以为我清理吗?
相关的C代码被包裹
%apply
指向数组结构(typedef struct _DRIVE
{
int nDriveId;
DRIVE_TYPE nDriveType;
DEV_STATUS sStatus;
char strDriveName[64];
char strSerialNumber[24];
char strFirmwareRev[16];
char strModelNumber[48];
unsigned long long ullTotalCapacity;
int nSMARTEnabled;
DRIVERINFO Driver;
union
{
SMARTATTRIBUTE smartAttributes[MAX_SUPPORTED_ATTRIBUTES];
NVME_SMART_DATA sSmartData;
SAS_SMART_DATA sSASSmartData;
};
SMARTTHRESHOLD smartThresholds[MAX_SUPPORTED_ATTRIBUTES];
union
{
CLIENT_DRIVE_INFO ClientDriveInfo;
NVME_DRIVE_INFO NVMEDriveInfo;
SAS_DRIVE_INFO SASDriveInfo;
};
} DRIVE, *PDRIVE;
)的方法。
pDrives
Swig界面文件:
STATUS GetAllDriveInfo(PDRIVE pDrives, int *nMaxDrives, DRIVE_TYPE type, STATUS *pDriveStatus);
目前我尝试在Python中作为第一个参数传递的任何东西都给了我:
TypeError:在方法' GetAllDriveInfo'中,类型' PDRIVE'
的参数1