Question regarding checksuming of a file

Heiko Wundram me+python at modelnine.org
Sun May 14 15:00:54 EDT 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