itertools question

Glauco glauco.uri at prometeia.it
Thu May 14 09:35:32 EDT 2009


Neal Becker ha scritto:
> Is there any canned iterator adaptor that will 
> 
> transform:
> in = [1,2,3....]
> 
> into:
> out = [(1,2,3,4), (5,6,7,8),...]
> 
> That is, each time next() is called, a tuple of the next N items is 
> returned.
> 
> 

http://stackoverflow.com/questions/312443/how-do-you-split-a-list-into-evenly-sized-chunks-in-python



Gla




More information about the Python-list mailing list