title: Python Updating RRDTool with Serial Port Data
body: <p>I am trying to update a RRDTool DB with serial information. Is it possible to declare the serial data as a variable in the update line? Using the code below, rrdtool doesn't see the N: timestamp. However if I manually enter the data following the "N:" it will update.</p>
  
  <pre><code>import serial
  import time
  import numpy
  import sys
  import rrdtool
  
  
  ser = serial.Serial('/dev/ttyUSB0', 9600)
  time.sleep(1)
  ser.flush()
  
  
  for i in range(2):
      ser.readline()
  
  
  while 1:    
      # Read data
      temp = ser.readline()
      ret = rrdtool.update('temperature.rrd', 'N:', temp)
      if ret:
       print rrdtool.error()
       time.sleep(5)
      quit()
  </code></pre>