2006年12月12日 星期二 19:50
c的.h文件是: #include#include typedef struct{ int numVec; long int personID; unsigned char **vecs; }PersonModel; typedef struct{ int numPerson; PersonModel *personmodel; }AllModels; typedef struct{ long int personID; double confidence; }PersonConf; typedef struct{ int numPerson; PersonConf *person; }AllPersonConf; AllPersonConf faceSearchEngine(unsigned char *novel, AllModels model); ==== 我写的ctypes定义文件 from ctypes import * import traceback class PersonModel(Structure): _fields_ = [("numVec", c_int), ("personID", c_int), ("vecs",POINTER(c_char_p))] class AllModels(Structure): _fields_ = [("numPerson", c_int), ("personmodel",POINTER(PersonModel))] class PersonConf(Structure): _fields_ = [("personID", c_int), ("confidence",c_double)] class AllPersonConf(Structure): _fields_ = [("numPerson", c_int), ("person",POINTER(PersonConf))] 请看看是否正确。 至少就有一个疑问,怎么操作 指针的指针的加减。 -- feihu <feihu.list在gmail.com>
Zeuux © 2025
京ICP备05028076号