I am trying to open a file in binary mode so that I can manipulate it at a bit level.
I am trying to obtain the binary information with:
with open('file.txt', 'rb') as f:
data = f.read()
but when I try to print this out I get a mixture of hex and some strange (to me) characters like the following
...~\xeb\xdd{\xdf\xba\xf7^\xf7\xee\xbd\xd7\...
how do I obtain the binary information as 0's and 1's with the ability to change 0110 1001 into 1001 0110