title: Sending byte strings to serial device
body: <p>I'm using Python3 running on a Raspberry. I have a serial device (max232/PiC16F84) connected to the Raspberry via an USB to Serial adapter.
  I try to send two bytes to the device (e.g 0000 0011) which then will be interpreted as a command by the PIC.
  The USB - serial adapter is configured correctly and the parameter such as bauderate should be ok. I guess that my code doesn't send the correct bytes to the serial port.</p>
  
  <pre><code>import serial
  
  ser = serial.Serial(
      port='/dev/ttyUSB0',
      baudrate=1200,
      parity=serial.PARITY_NONE,
      stopbits=serial.STOPBITS_ONE,
      bytesize=serial.EIGHTBITS,
      xonxoff=serial.XOFF,
      rtscts=False,
      dsrdtr=False
  )
  
  ser.open()
  ser.isOpen()
  
  print("Initializing the device ..")
  
  ser.write(bytes(0x00))
  
  print("Write command")
  ser.write (bytes(0x04))
  
  print('Done')
  </code></pre>