Aug-28-2020, 09:54 AM
Hi, I have been given a file and was told it was a binary file.
In Python I can open the file and read what I think is for four bytes (4).
byte = f.read(4)
print(byte)
In the shell I get
b'B\xda\xed\xc5' for example
I would like to get this in the form of something like 00001111 10100000 10101010 10100000
Without the spaces or able to remove the spaces.
So that I can convert it into int32.
(I was hoping to put up a screen capture, however I cannot see a way to do so).
Hope some one can help, there may be a better way to go about this.
Thanks,
In Python I can open the file and read what I think is for four bytes (4).
byte = f.read(4)
print(byte)
In the shell I get
b'B\xda\xed\xc5' for example
I would like to get this in the form of something like 00001111 10100000 10101010 10100000
Without the spaces or able to remove the spaces.
So that I can convert it into int32.
(I was hoping to put up a screen capture, however I cannot see a way to do so).
Hope some one can help, there may be a better way to go about this.
Thanks,