Skip to content

Instantly share code, notes, and snippets.

@PiotrZakrzewski
Created October 2, 2015 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PiotrZakrzewski/cb5b641442c63158e764 to your computer and use it in GitHub Desktop.
Save PiotrZakrzewski/cb5b641442c63158e764 to your computer and use it in GitHub Desktop.
chunker.py
def chunker(seq, size):
return (seq[pos:pos + size] for pos in xrange(0, len(seq), size))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment