from serial import Serial as ser

port = raw_input("/dev/ttyUSB")
baud = raw_input("Baudrate: ")

dev = ser("/dev/ttyUSB" + port, baudrate=baud)

while True:
    dev.flush()

    dev.write("RID\n")

    try:
        print "%s" % dev.readline() 
    except KeyboardInterrupt:
        print "Failed to receive"

    cont = raw_input("Continue? (y/n)")



    if cont == "n":
        break

dev.close()


cfef43cb3ba7f142b1b2fb67970b9fdacb90d91b
from serial import Serial as ser

port = raw_input("/dev/ttyUSB")
baud = raw_input("Baudrate: ")

dev = ser("/dev/ttyUSB" + port, baudrate=baud)

while True:
    dev.flush()

    dev.write("RID\n")

    try:
        print "%s" % dev.readline() 
    except KeyboardInterrupt:
        print "Failed to receive"

    cont = raw_input("Continue? (y/n)")



    if cont == "n":
        break

dev.close()

