I'm currently working on a conversion script to convert between formats.
When I use binascii to convert a user given ascii string to binary a 'b' appears in the output. At first I thought it has something to do with the bytes data format that is required but if I try to reverse the process something completely different appears.
if encodetooption == 'B':
encodestring = encodestring.encode()
encodedstring = bin(int(binascii.hexlify(encodestring), 16))
produces this e.g:
0b1100001011011000110010101111000
can someone explain why that is so and how it can be reversed properly or how it can be done better.