Problem with python array's...

Alex Martelli aleaxit at yahoo.com
Fri Oct 10 18:45:32 EDT 2003


MangoMan wrote:

> 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...

Alex





More information about the Python-list mailing list