Re: [Tutor] Problem reading large files in binary mode

2014-06-13 Thread Mirage Web Studio
Thank you, i will keep all that in mind. My python version is 3.3.5 George On 13-06-2014 16:07, Peter Otten wrote: Mirage Web Studio wrote: Try reading the file in chunks instead: CHUNKSIZE = 2**20 hash = hashlib.md5() while True: chunk = f.read(CHUNKSIZE) if not chunk:

Re: [Tutor] Problem reading large files in binary mode

2014-06-13 Thread Peter Otten
Mirage Web Studio wrote: > Try reading the file in chunks instead: > > CHUNKSIZE = 2**20 > hash = hashlib.md5() > while True: > chunk = f.read(CHUNKSIZE) > if not chunk: > break > hash.update(chunk) > hashvalue = hash.hexdigest() > > > Thank you peter for the above valub

[Tutor] Problem reading large files in binary mode

2014-06-13 Thread Mirage Web Studio
Try reading the file in chunks instead: CHUNKSIZE = 2**20 hash = hashlib.md5() while True: chunk = f.read(CHUNKSIZE) if not chunk: break hash.update(chunk) hashvalue = hash.hexdigest() Thank you peter for the above valubale reply. but shouldn't read() by itself work becaus