[Numpy-discussion] ArgumentError when using numpy.ctypeslib.ndpointer

Pauli Virtanen pav@iki...
Sun Mar 11 06:33:26 CDT 2012


11.03.2012 09:09, Christoph Gohlke kirjoitti:
> I am unable to get the simple numpy.ctypeslib.ndpointer docstring
> example from
> <http://docs.scipy.org/doc/numpy/reference/routines.ctypeslib.html>
> working on Windows.
> 
> Given a DLL `foo.dll` that exports a function `int bar(double *)`,
> calling foo.bar using the np.ctypeslib.ndpointer approach always fails
> with a ctypes.ArgumentError:
> 
> In [5]: foo = ctypes.CDLL('foo.dll')
> In [6]: foo.bar.argtpes = [np.ctypeslib.ndpointer(dtype=np.float64,
> ndim=1, flags='C_CONTIGUOUS')]

Typo: "argtpes" -> "argtypes"

Probably not Windows-specific :)

-- 
Pauli Virtanen



More information about the NumPy-Discussion mailing list