#!/usr/bin/python import serial while 1: try: ser = serial.Serial('/dev/ttyUSB0', 9600) while 1: print ser.readline() except Exception, e: pass