Make a .bin file human readable in python

108 Views Asked by At

I am getting a .bin file from a C++ program. File has content similar to one below. 12 MyName here 456

How can I read this file in python and make the content human readable?

I am trying with the program below. But it just gives me a byte string.

binary_file_path = "binary_file.bin"
with open(binary_file_path, "rb") as b_file:
   binary_data = b_file.read()

print(binary_data)

I just want to display contents of .bin file in human readable format.

0

There are 0 best solutions below