title: pySerial sending and receiving multiple data
body: <p>I have a question about sending and receiving multiple data using the pySerial Python library. According to what I understand, serial port communication works with byte variables.</p>
  
  <p>How do I send four different variables with method <code>write</code> and then with method <code>read</code> receive two different variables?</p>
  
  <p>As an example:</p>
  
  <pre><code>import serial
  import time
  
  sendSerial = serial.Serial ("COM4", 9600)
  readoutSerial = serial.Serial ("COM4", 9600)
  time.sleep (2)
  sendSerial.write ("data1" + "data2" + "data3" + "data4")
  while True:
      readoutSerial.read ("data5" + "data6")
  </code></pre>
  
  <p>What should I do to send the four variables with <code>write</code> differentiated by some character and then separate them for the respective use of each variable? (applying the same for the two variables received with <code>read</code>) Also, what can I do to send the variables as<code>float</code> and not generate conflict with the reading in <code>byte</code>?</p>