Hi there,
I am still writing on a python interface for my c code with ctypes. Today I substituted my file reading function with a python version, which was programmed by somebody else usind NumPy. The 'old' c version was called with a byref(p_data) while p_data=PFloat() (see below). The main function takes the p_data.
Old file reading:
p_data=POINTER(c_float)
foo.read(filename,byref(p_data))
result=foo.pymain(p_data)
The python file reading function on the other hand returns a NumPy array. My question now is:
How do I convert a NumPy array to POINTER(c_float)?
I googled but only found the other way around: C arrays through ctypes accessed as NumPy arrays and things I didn't understand: C-Types Foreign Function Interface (numpy.ctypeslib)
[update] corrected a mistake in the example code