Use format
:
>>> text = '142.55.33.1'
>>> ' ' .join(format(int(x), '08b') for x in text.split('.'))
'10001110 00110111 00100001 00000001'
In case if you want a list:
>>> [format(int(x), '08b') for x in text.split('.')]
['10001110', '00110111', '00100001', '00000001']
Here format converts an integer to its binary string representation:
>>> format(8, 'b')
'1000'
>>> format(8, '08b') #with padding
'00001000'