title: Map serial port data into integer
body: <p>I am intending to retrieve a string from arduino through serial port. How do I map the string into an integer/float? Here's my current code using Python. What I would want to achieve is to be able to read the first value as a number.</p>
  
  <pre><code>import serial
  ser = serial.Serial('COM7', 9600)
  
  try:
      result=ser.readline()
      pieces=result.split(" \t")
      map(float, pieces)
      print pieces
      if pieces[0] == 5.0:
          print "Yes"
      else:
          print "No"
  except:
      print "Failed to get data from Arduino!"
  </code></pre>
  
  <p>Results:</p>
  
  <pre><code>[5.0, 23.2, 88.17]
  ['5', '23.20', '88.17\r\n']
  No
  </code></pre>