On Mon, 2007-07-16 at 16:31 -0500, marduk wrote: > Assuming you meant '0xF0' instead of '0x80'.... do you mean any value > >=240 starts a new group? If so: > > groups = [] > current = [] # probably not necessary, but as a safety > for i in l: > if i >= 240: > current = [] > groups.append(current) > current.append(i) > >
Misunderstood... actually that should have read groups = [] current = [] # probably not necessary, but as a safety for i in l: if 240 & i: current = [] groups.append(current) current.append(i) -- http://mail.python.org/mailman/listinfo/python-list