John Machin <[EMAIL PROTECTED]> writes: > > numlist = lookup_table[num] > > where lookup_table is a precomputed list of lists. > Ummm ... didn't the OP say he had 32-bit numbers???
He asked about 8 bit numbers. I saw something about 32-bit numbers but figured those would be split into bytes or something: (untested and I don't remember if this is the byte order wanted): from itertools import chain numlist = list(chain(lookup_table[(num>>i)&0xff] for i in xrange(0,32,8))) -- http://mail.python.org/mailman/listinfo/python-list