python 怎么获得c++ 函数的指针返回值 from ctypes import * import ctypes # 加载动态库 Objdll = cdll.LoadLibrary('./libChCDriverLinuxFR.so') x=Objdll.OpenAllSpectrometer() print(x) y=Objdll.GetNumberOfPixels(0) print(y) Objdll.GetWavelengths.restype = POINTER(c_double) #需要加这一句,将类型的返回值定义为double指针 z=Objdll.GetWavelengths(0) print(z[2]); Filed under: Python,编程,跨语言编程 - @ 2021年9月1日 下午10:00