title: ValueError: invalid literal for int() with base 16: '\x0e\xa3' Python
body: <p>I get bytes from the serial port which represents the voltage on my PIC board.
  But I can't convert these bytes(strings) to decimal because I get the error message above.
  Here is the function(in fact, it's associated with tkinter button)</p>
  
  <pre><code>def channel8():
      ser.write(chr(0xFF))
      print "you have select channel8"
      x=ser.read(2)
      w=int(x, 16)
      print w
      print "Voltage on channel8 is:" , x
  </code></pre>
  
  <blockquote>
    <p>ValueError: invalid literal for int() with base 16: '\x0e\xa3'</p>
  </blockquote>
  
  <pre><code>def channel8():
      ser.write(chr(0xFF))
      print "you have select channel8"
      x=ser.read(2)
      z=struct.unpack("h", x)
      #w=int(z, 16)
      print z
  </code></pre>
  
  <p>and i get this : </p>
  
  <blockquote>
    <p>Voltage on channel8 is: (28942,)</p>
  </blockquote>
  
  <p>can you please explain how did i get this value? it's not matching anything :D</p>