title: python3.9 'byte' data handling
body: <p>I'm working on a 6809 python processor emulator for educational purposes.</p>
  <p>I have a short binary file on the hard drive. The data is raw assembler output for a Motorola MC6809 that has the following contents:</p>
  <pre><code>0000300000338cfd4f5f10eec9100012126ec90010adc900186e4c12124cb10255270339121232624f5cf1025527046e4c12126ec4ff00000000
  </code></pre>
  <p>Actual code data:</p>
  <pre><code>338cfd4f5f10eec9100012126ec90010adc900186e4c12124cb10255270339121232624f5cf1025527046e4c12126ec4
  </code></pre>
  <p>Using python3.9 how do I get this into a list mem[] as either:</p>
  <pre><code>mem[00,00,30,00,00,33,8c,fd,4f,5f,...]
  </code></pre>
  <p>I suspect since ascii characters are involved here quotes would be needed</p>
  <p>or</p>
  <pre><code>mem[0x00,0x00,0x30,0x00,0x00,0x33,0x8c,0xfd,0x4f,0x5f,...]
  </code></pre>
  <p>all I can seem to do is get the data back as</p>
  <pre><code>mem[b'00',b'00',b'30',b'00',b'00',b'33'.b'8c',b'fe',b'4f',b'5f',...]
  </code></pre>
  <p>But I can't seem to typecast these byte values into anything usable.</p>
  <p>I've tried a half a dozen methods, with some questionable/unusable results.</p>