import serial, sys port = "/dev/ttyUSB0" baudrate = 57600 ser = serial.Serial(port,baudrate,timeout=0.001) while True: ser.write(bytearray([0x3c, 0x3e, 0x10, 0x0d, 0x0a])) if ser.inWaiting() > 0: data = list(ser.read(64)) print data sys.stdout.flush()