Re: pass float array(list) parameter to C

2008-03-17 Thread Gabriel Genellina
En Mon, 17 Mar 2008 01:17:31 -0200, zaley [EMAIL PROTECTED] escribi�: In my program, python is communicated with C use ctypes . I can't find a better way to pass float array(list) parameter to C function. Can someone give me a help? Use the array module to create an array of floats, like

Re: pass float array(list) parameter to C

2008-03-17 Thread marek . rocki
You can also do it with ctypes only; too bad it's not really well documented. c_float is a type of a floating point number and it has * operator defined, so that c_float*4 is a type of a 4-element array of those numbers. So if you want to construct an array of floats from a list of floats, you can

Re: pass float array(list) parameter to C

2008-03-17 Thread zaley
On Mar 17, 10:59 pm, [EMAIL PROTECTED] wrote: You can also do it with ctypes only; too bad it's not really well documented. c_float is a type of a floating point number and it has * operator defined, so that c_float*4 is a type of a 4-element array of those numbers. So if you want to construct

pass float array(list) parameter to C

2008-03-16 Thread zaley
In my program, python is communicated with C use ctypes . I can't find a better way to pass float array(list) parameter to C function. Can someone give me a help? -- http://mail.python.org/mailman/listinfo/python-list