title: convert hex string (python 2) to byte with hex numbers in Python 3
body: <p>I'm converting my code so it works with Python 3. The main remaining issue is to successfully use a serial.write command. In my previous code I made a string like this:
  read_frame='\xAA\x00\x01\x00\x00\x00\x65\x00\x00\x00\x0A\x00\x6F\x71'. And then used serial.write(read_frame) to send this string.</p>
  
  <p>In Python 3, however, I have to convert this to a 'byte' in order to be able to use serial.write(read_frame). If it was a static frame it is sufficient to declare it as:
  read_frame_byte=b'\xAA\x00\x01\x00\x00\x00\x65\x00\x00\x00\x0A\x00\x6F\x71'</p>
  
  <p>The problem, is however, that I create this hex string dynamically, so in the end I have to convert the string to byte. If i'm using the command read_frame.encode('utf-8'), the conversion results in different hex number (x65 becomes xe, for example, as this is the corresponding ASCII value). This is technically correct, but I just want to convert the string to a byte without changing any values. Any suggestions/workarounds to make this conversion?</p>