title: Serial communication : Send a list from Python3 to Arduino
body: <p>I don't manage to deal with my problem even if I have read a lot about it on internet these last few days.
  I try to communicate a variable length list from my Python3 program to my Arduino Leonardo.
  Actually the length of these lists is variable but there are only three possible length :</p>
  <pre><code>first possibility : [0, 0, 1, 176, 1, 0, 0]
  second possibility : [0, 1, 11, 255]
  third possibility : [0, 2, 0]
  </code></pre>
  <p>(most of the values inside these lists are variables)</p>
  <p>My Python3 code :</p>
  <pre><code>with Serial(port = port, baudrate=9600, timeout=1, writeTimeout=1) as port_serie :
    if port_serie.isOpen() :
      for value in Datas_To_Send : #Envoi des données
        s = struct.pack('!{0}B'.format(len(Datas_To_Send)), *Datas_To_Send)
        port_serie.write(s)
  </code></pre>
  <p>This code sends binary values like this one :</p>
  <pre><code>b'\x00\x00\x01\xb0\x01\x00\x00'
  (the original list to send was : [0, 0, 1, 176, 1, 0, 0])
  </code></pre>
  <p>The problem is that I absolutely don't know how to find back my original list of values with my Arduino code...</p>
  <p>My Arduino code (quite basic) :</p>
  <pre><code>void changeSettings() {
    if ( Serial.available() &gt; 0 ) {
      int byte_read = Serial.read() ;
      Serial.println(byte_read, DEC) ;
  </code></pre>
  <p>The output of this code is a pure conversion of each character from the ASCII to the Decimal...</p>
  <p>Output (for the binary value I gave as example) :</p>
  <pre><code>98
  39
  92
  120
  48
  48
  92
  120
  48
  48
  92
  120
  48
  49
  92
  120
  98
  48
  92
  120
  48
  49
  92
  120
  48
  48
  92
  120
  48
  48
  39
  10
  </code></pre>
  <p>Do you have any idea to find the first list back ?</p>
  <p>Thank you</p>