I want to convert a bin file to txt file in python.
with open("atb.bin", "rb") as file:
data = file.read(8)
datastring = str(data)
print(datastring)
print(' '.join(str(ord(c)) for c in datastring))
The output I get is
b'\x14\x12\x1c\x1a#\x00-d'
98 39 92 120 49 52 92 120 49 50 92 120 49 99 92 120 49 97 35 92 120 48 48 45 100 39
Now, how do I convert this to decimal and store in a txt file?