Break a list into roughly equal sized pieces.
1 2 3 4 5 6
def split_seq(seq, size): newseq =  splitsize = 1.0/size*len(seq) for i in range(size): newseq.append(seq[int(round(i*splitsize)):int(round((i+1)*splitsize))]) return newseq
This requires that you know the length of the list beforehand, of course, so you can't use it with an arbitrary sequence as is. It's simple, but it's easy to create fencepost errors when implementing it.
>>> split_seq(range(10), 3) [[0, 1, 2], [3, 4, 5, 6], [7, 8, 9]]