Re: Help on ctypes.POINTER for Python array

2023-05-11 Thread Jason Qian via Python-list
Awesome, thanks! On Thu, May 11, 2023 at 1:47 PM Eryk Sun wrote: > On 5/11/23, Jason Qian via Python-list wrote: > > > > 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

Re: Help on ctypes.POINTER for Python array

2023-05-11 Thread Eryk Sun
On 5/11/23, Jason Qian via Python-list wrote: > > 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? > >

Re: Help on ctypes.POINTER for Python array

2023-05-11 Thread Jim Schwartz
I’m not sure this is the shortest method, but you could set up two python scripts to do the same thing and convert them to c using cython. I wouldn’t be able to read the c scripts, but maybe you could. Maybe someone else has a more direct answer. Sent from my iPhone > On May 11, 2023, at

Help on ctypes.POINTER for Python array

2023-05-11 Thread Jason Qian via Python-list
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()]