Help on ctypes.POINTER for Python array

Jason Qian jqian at tibco.com
Thu May 11 10:59:01 EDT 2023


Hi,

Need some help,

in the Python, I have a array of string

 var_array=["Opt1=DG","Opt1=DG2"]

I need to call c library and  pass var_array as parameter

In the   argtypes,  how do I set up ctypes.POINTER(???)  for var_array?

func.argtypes=[ctypes.c_void_p,ctypes.c_int, ctypes.POINTER(????)]

In the c code:

int  func (void* obj, int index,  char** opt)

Thanks
Jason


More information about the Python-list mailing list