I'm currently writing a program in python that compresses a file using Huffman coding. Because of python I have been having problems trying to program on such a low level. A problem that I was not able to wrap my head around is decoding (I encode the file I'm reading in a .bin file), because everything I have found so far reads the binary file byte by byte or as hex, I am not able to implement decompression.
So my question is, can I read a binary file in python bit by bit such as to have a variable: binary_text = '0b1000101000...'