News for hackers. Stuff that matters.
Re:Playing with Strings and Colors in Python by hythloday on Friday December 28, 2012 @11:00AM (#4978121)
You can get rid of that unpleasant indexing:

(3.2)

    from itertools import cycle
    for colour, character in zip(cycle(colours), string):
      print(termcolor.colored(character, colour))
(2.7)

    from itertools import cycle, izip
    for colour, character in izip(cycle(colours, string):
      print termcolor.colored(character, colour)
Re:Playing with Strings and Colors in Python by barakstout on Friday December 28, 2012 @11:13AM (#4978176)
Sweet. Thanks.