【发布时间】:2018-08-02 14:11:19
【问题描述】:
我有一个 c++ 函数:
double* hiho() {
double *res = new double[10];
return res;
}
一起
from numpy.ctypeslib import ndpointer
mylib.hiho.restype = ndpointer(dtype=ctypes.c_double, shape=(10,))
调用函数时出现如下错误:
ValueError: '<P' is not a valid PEP 3118 buffer format string
我使用 Python 3.6.2
我做错了什么?
【问题讨论】:
标签: python multidimensional-array ctypes