Is there any neat trick to slice a binary number into groups of five digits in python?
\'00010100011011101101110100010111\' => [\'00010\', \'00110\', \'10111\', ... ]
Another way to group iterables, from the itertools examples:
def grouper(n, iterable, fillvalue=None): "grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx" args = [iter(iterable)] * n return izip_longest(fillvalue=fillvalue, *args)