Decimal to Binary Conversion and vice-versa in Python
Rather than repeating the same logic you could make a couple of functions binary_to_decimal and decimal_to_binary.

def binary_to_decimal(num):
    return int("{0:d}".format(num), 2)

def decimal_to_binary(num):
    return int("{0:b}".format(num))


Whilst it doesn't have too big an impact on the readability of your code it abstracts the code enough for anyone passing by to understand what you mean when you're doing the string formatting. You could also change binary_to_decimal to use str rather than string formatting, as I don't think we're going to change to the binary form any time soon. I also thing your string formatting for changing to binary is better than using bin as you'd have to cut the first 0b off the output of bin, which would make the code more cryptic.