Steve Howell <showell30 at yahoo.com> wrote: ... > for has_chars, frags in itertools.groupby(lines, > lambda x: len(x) > 0): Hmmm, it appears to me that itertools.groupby(lines, bool) should do just the same job, just a bit faster and simpler, no? Alex