How can I define a multidimensional array in python using ctype?

0 votes
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?
Oct 9, 2018 in Python by charlie_brown
• 7,720 points
265 views

1 answer to this question.

0 votes

Here's one quick-and-dirty method:

>>> A = ((ctypes.c_float * 10) * 10)
>>> a = A()
>>> a[5][5]
0.0
answered Oct 9, 2018 by ariaholic
• 7,340 points

Related Questions In Python

0 votes
1 answer
0 votes
1 answer

How can I lookup hostname using the IP address with a timeout in Python?

Good question. I actually was stuck with ...READ MORE

answered Feb 6 in Python by Nymeria
• 3,520 points
62 views
0 votes
1 answer

How can I write a program to add two numbers using functions in python?

def add(a,b):      return a + b #when i call ...READ MORE

answered May 20 in Python by Mohammad
• 3,060 points
45 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 173 views
0 votes
1 answer

How can I rename multiple files in a certain directory using Python?

Use os.rename(src, dst) to rename or move a file ...READ MORE

answered Nov 23, 2018 in Python by ariaholic
• 7,340 points
105 views
0 votes
1 answer

How can I turn an input date into a readable string in Python?

The datetime class has a method strftime. strftime() ...READ MORE

answered Dec 11, 2018 in Python by ariaholic
• 7,340 points
33 views