On Thu, 30 Oct 2008 16:40:17 -0500, Grant Edwards wrote: > If you want to do it "on the fly", then try something like this: > > iter = [1,2,3,4,5].__iter__() > sys.stdout.write(str(iter.next())) > for n in iter: > sys.stdout.write(',' +str(n))
Maybe without shadowing the built in `iter()` and without calling the "magic method" directly: iterator = iter([1, 2, 3, 4, 5]) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list