Mercurial > hg > Lemuriformes
view lemuriformes/chunk.py @ 10:ad1bf59eedb0
[SQL] add count CLI front-end
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sun, 10 Dec 2017 13:57:33 -0800 |
parents | 244c29f46554 |
children |
line wrap: on
line source
def chunk(data, chunksize=100000): """ chunk `data` into smaller sizes of `chunksize` """ offset = 0 chunk = data[0:chunksize] while chunk: yield chunk offset += chunksize chunk = data[offset:offset+chunksize]