f = open("DSC09311-256.data.pal", 'rb') b = f.read() def grouper(iterable, n): args = [iter(iterable)] * n return zip(*args, strict=True)