title: Python string formatting to send through serial port
body: <p>I need to properly format the string in order to send it to the arduino connected through a serial port. For example I have this python2.7.5 code:</p>
  
  <pre><code>x = int(7)
  y = int(7000.523)
  self.ser.write("%s%s" % (x, y))
  </code></pre>
  
  <p>but I want x in a byte and y in different bytes from x so I can assign a variable for each recieved byte in the arduino code similar to this:</p>
  
  <pre><code>for (i=0; i&lt;3; i++) 
    {
     bufferArray[i] = Serial.read();
    } 
  d1 = bufferArray[0];
  d2 = bufferArray[1];
  d3 = bufferArray[2];
  x = d1;
  y = (d2 &lt;&lt; 8) + d3;
  </code></pre>
  
  <p>In other words, I don't want that a piece of y is in the x byte.
  What is the proper string format to do this?</p>