Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/314.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Python中使用ctypes.structure类的插槽?_Python_Python 2.7 - Fatal编程技术网

如何在Python中使用ctypes.structure类的插槽?

如何在Python中使用ctypes.structure类的插槽?,python,python-2.7,Python,Python 2.7,我正在用Python2.7编写一个应用程序,它将大量3D网格结构从一个应用程序导出到另一个应用程序 由于大量的3D数据,我定义了一个名为“Face”的类作为传递到c-dll的临时数据结构,如下代码所示 我的问题:如果我想用插槽保存memeory,如何重新定义这个类?或者有没有其他方法可以有效地保存内存 类面(ctypes.Structure): __插槽\uuux=() #_uuu插槽uuu=['A'、'B'、'C'、'vert_index'、'vert_index'、'edge_sm'、's

我正在用Python2.7编写一个应用程序,它将大量3D网格结构从一个应用程序导出到另一个应用程序

由于大量的3D数据,我定义了一个名为“Face”的类作为传递到c-dll的临时数据结构,如下代码所示

我的问题:如果我想用插槽保存memeory,如何重新定义这个类?或者有没有其他方法可以有效地保存内存


类面(ctypes.Structure):
__插槽\uuux=()
#_uuu插槽uuu=['A'、'B'、'C'、'vert_index'、'vert_index'、'edge_sm'、'sm_group'、'is_hidden'、'edge_hidden'、'mtl_index'、'uv']
_字段=[
(“A”,ctypes.POINTER(ctypes.c_double)),
(“B”,ctypes.POINTER(ctypes.c_double)),
(“C”,ctypes.POINTER(ctypes.C_double)),
(“垂直索引”,ctypes.POINTER(ctypes.c_int)),
(“edge_sm”,ctypes.POINTER(ctypes.c_bool)),
(“sm_集团”,ctypes.c_int),
(“是隐藏的”,ctypes.c_bool),
(“边缘隐藏”,ctypes.POINTER(ctypes.c_int)),
(“mtl_索引”,ctypes.c_int),
(“uv”,ctypes.POINTER(ctypes.c_double)),
]
谢谢你的建议。谢谢