title: Python.. convert bin/hex file to txt file
body: <p>I want to convert a bin file to txt file in python.</p>
  
  <pre><code>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))
  </code></pre>
  
  <p>The output I get is </p>
  
  <pre><code>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
  </code></pre>
  
  <p>Now, how do I convert this to decimal and store in a txt file?</p>