Problem with python array's...
aleaxit at yahoo.com
Sat Oct 11 00:45:32 CEST 2003
> Hi there,
> Currently i am having a problem with python's array class.
> I am reading 3 arrays from a file (self.buffer32, self.buffer16,
> self.buffer8 from self.fs) :
> # ...
> self.Allocated32 = offset16
> self.Allocated16 = offset8-offset16
> self.Allocated8 = totalSize-offset8
> print "Array should be size %d %d %d (32, 16, 8)" % (self.Allocated32,
> self.Allocated16, self.Allocated8)
Hmmm -- are the len(...) of the three arrays zero at this point?
The fromfile method appends what it reads to what was already
in the array, rather than overwriting it -- and I don't see your code
emptying out these arrays nor checking them for 0 length...
More information about the Python-list