#! /usr/bin/python import serial ; ser = serial.Serial('/dev/ttyUSB0', 57600) ; line = ser.readline() ; ser.close() ; print 'Content-type: application/json' print print line ;