Ask Your Question

Revision history [back]

I'm not sure what [1, 1, 0, 0, 0, 0, ...] has to do with 128, but if you want the base 10 digits:

>>> a = 1234
>>> [int(d) for d in str(a)]
>>> [1, 2, 3, 4]

For base 2 instead of base 10, try Google. I found http://stackoverflow.com/questions/187273/base-2-binary-representation-using-python, for example.