def chunkiter(fp, chunk_size=65536):
 while True:
  chunk = fp.read(chunk_size)
  if chunk:
   (yield chunk)
  else:
   break

def chunkiter ( fp , chunk_size = 65536 ) : while True : chunk = fp . read ( chunk_size ) if chunk : ( yield chunk ) else : break
return an iterator to a file-like obj which yields fixed size chunks .