Это структура:
Код: Выделить всё
typedef struct {
float x;
float y;
float z;
float radius;
} Sphere;
Код: Выделить всё
void render(Sphere** spheres);
Код: Выделить всё
lib_render = ctypes.cdll.LoadLibrary('librender.so')
class Sphere(ctypes.Structure):
_fields_ = [('x', ctypes.c_float),
('y', ctypes.c_float),
('z', ctypes.c_float),
('radius', ctypes.c_float)]
render = lib_render.render
render.argtypes = []
spheres = numpy.array([Sphere(1, 2.8, 3, 0.5),
Sphere(4.2, 2, 1, 3.2)])
render(spheres)
Подробнее здесь: https://stackoverflow.com/questions/470 ... rom-python
Мобильная версия