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,780 points
1,655 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 aryya
• 7,440 points

Related Questions In Python

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, 2019 in Python by Nymeria
• 3,520 points
1,012 views
0 votes
2 answers

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

there is sum() function as a built ...READ MORE

answered Oct 24, 2020 in Python by anonymous
14,226 views
0 votes
2 answers
+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, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,973 views
0 votes
0 answers
0 votes
2 answers

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

import os from optparse import OptionParser, Option class MyOption ...READ MORE

answered Jul 28, 2020 in Python by The real slim shady
3,249 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 aryya
• 7,440 points
100 views