memory error

Heiko Wundram heikowu at
Wed Jun 2 15:19:47 CEST 2004

Am Mittwoch, 2. Juni 2004 15:11 schrieb Bart Nessux:
>           size =

You read the complete content of the file here. size will not contain the 
length of the file, but the complete file data. What you want is either 
len( (which is sloooooooooow), or have a look at os.path.getsize().

>           size_list.append(size)

This appends the complete file to the list. And as such should explain the 
memory usage you're seeing...



More information about the Python-list mailing list