Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python: Multi-Dimensional Array Using ctypes?

Tags:

python

ctypes

How do I define a multi-dimensional float array using ctypes in python?

Is there a limitation to the number of dimensions that can be defines?

like image 658
user3262424 Avatar asked Jul 05 '11 15:07

user3262424


1 Answers

Here's one quick-and-dirty method:

>>> A = ((ctypes.c_float * 10) * 10)
>>> a = A()
>>> a[5][5]
0.0
like image 114
senderle Avatar answered Oct 13 '22 00:10

senderle