I forgot to mention that I did a simple timeit test which doesn't
show
significant runtime difference 3.5 sec for dictionary case and 3.48
for
list case.
def read_as_dictionary():
fil = open('myDataFile', 'r')
forces = {}
for region in range(25):
forces[region] = {}
for step in range(20000):
for region in range(25):
line = fil.next(); spl = line.split()
forces[region] [step] = spl
def read_as_list():
fil = open('myDataFile.txt', 'r')
forces = []
for region in range(25):
forces.append([])
for step in range(20000):
for region in range(25):
line = fil.next(); spl = line.split()
forces[region].append(spl)
Cheers,
/Ben
--
http://mail.python.org/mailman/listinfo/python-list