Re: istep() addition to itertool? (Was: Re: Printing n elements per line in a list)

2006-08-21 Thread Neil Cerutti
On 2006-08-19, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > unexpected wrote: >> If have a list from 1 to 100, what's the easiest, most elegant >> way to print them out, so that there are only n elements per >> line. > > I've run into this problem a few times, and although many > solutions have been

Re: istep() addition to itertool? (Was: Re: Printing n elements per line in a list)

2006-08-20 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Justin Azoff wrote: > Rhamphoryncus wrote: > [snip interesting istep function] > >> Would anybody else find this useful? Maybe worth adding it to itertool? > > yeah, but why on earth did you make it so complicated? > > def istep(iterable, step): > a=[] > for x

Re: istep() addition to itertool? (Was: Re: Printing n elements per line in a list)

2006-08-20 Thread Justin Azoff
Rhamphoryncus wrote: > I've run into this problem a few times, and although many solutions > have been presented specifically for printing I would like to present a > more general alternative. [snip interesting istep function] > Would anybody else find this useful? Maybe worth adding it to itert

istep() addition to itertool? (Was: Re: Printing n elements per line in a list)

2006-08-19 Thread Rhamphoryncus
unexpected wrote: > If have a list from 1 to 100, what's the easiest, most elegant way to > print them out, so that there are only n elements per line. I've run into this problem a few times, and although many solutions have been presented specifically for printing I would like to present a more g