Question regarding checksuming of a file

Heiko Wundram me+python at modelnine.org
Sun May 14 21:00:54 CEST 2006


Am Sonntag 14 Mai 2006 20:51 schrieb Andrew Robert:
>  def getblocks(f, blocksize=1024):
>  	while True:
>  		s = f.read(blocksize)
>  		if not s: return
>  		yield s

This won't work. The following will:

def getblocks(f,blocksize=1024):
    while True:
        s = f.read(blocksize)
        if not s: break
        yield s

--- Heiko.



More information about the Python-list mailing list