I\'ve created a method to convert an int to a bitfield (in a list) and it works, but I\'m sure there is more elegant solution- I\'ve just been staring at it for to
int
Try
>>>n=1794 >>>bitfield=list(bin(n))[2:] >>>bitfield ['1', '1', '1', '0', '0', '0', '0', '0', '0', '1', '0']
This does not work for negative n though and as you see gives you a list of strings