Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python chunks iterator

def grouper(n, iterable, fillvalue=None):
    "grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx"
    args = [iter(iterable)] * n
    return izip_longest(fillvalue=fillvalue, *args)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #chunks #iterator
ADD COMMENT
Topic
Name
5+4 =