View Single Post
Old 01-17-2007, 04:11 PM   #1 (permalink)
QUantumAnenome
Code Monkey
 
Join Date: Mar 2005
Posts: 56
QUantumAnenome is on a distinguished road
Send a message via Yahoo to QUantumAnenome
Python - Multidimensional arrays?

I just figured out how to do arrays in python.
I have a C++ program that spits out a binary float array
float f[8][5][60];

In python script that reads it in, I do this right now:

Code:
f = file("d:/float.bin", "rb")
a = array('f')
a.fromfile(f, 8*5*60)
And I do the indexing math myself to get an element.

What is the preferred method for using multidimensional arrays in python?

THanks.
QUantumAnenome is offline   Reply With Quote