title: python, pyserial to read reply data
body: <p>I write to my device in hexadecimal format using <code>pyserial</code>:</p>
  
  <pre><code>ser.write("\x01\x03\x00\x00\x00\x0A\xC5\xCD")
  data = ser.readline()
  print data
  </code></pre>
  
  <p>The output is:</p>
  
  <pre><code>Q,f�    ��
  Q.f�    �   
  Q8f�    �B
  Q5f�    �
  </code></pre>
  
  <p>My problem is how to show the output in hex format, for instance </p>
  
  <pre><code>01 03 14 50 AD 00 00 00 00 00 00 00 00 00 00 66 DC 00 00 00 09 00 00 A8 42
  </code></pre>
  
  <p>Also, how can I convert to decimal:</p>
  
  <pre><code>50AD = 20653
  66DC = 26332
  </code></pre>