0
这不起作用:蟒蛇ctypes的阵列将不会返回正确
def CopyExportVars(self, n_export):
export_array = (ctypes.c_double * n_export)()
self.dll_handle.vs_copy_export_vars(ctypes.cast(export_array, ctypes.POINTER(ctypes.c_double)))
return export_array().contents
我得到这个错误(n_export
3):
TypeError: 'c_double_Array_3' object is not callable
'回报export_array.contents'? –
@ŁukaszRogalski没有parens,它抱怨没有'内容'的属性。 – Jiminion
Geez,对不起,'export_array'是值,而不是指针。因为它是一个'ctypes'数组,所以你可以索引它来取消值,'export_array [0]'全部到'export_array [n_export-1]' –