##If Input On Jump to Tab## if (cmdType == "If On "): inputIndex = command.find("Input-") tabIndex = command.find("Tab-") inputNum = str(command[inputIndex+6:tabIndex-9]) tabNum = str(command[tabIndex+4:]) command = "JFX"+inputNum+"T"+tabNum+"\n" ser.write(command.encode()) ser.flushInput() time.sleep(.2) value = ser.readline() ***************************************************this with: value = ser.read() if (value == b'T'): index = tab1.progView.get(0, "end").index("Tab Number " + tabNum) index = index-1 tab1.progView.selection_clear(0, END) tab1.progView.select_set(index) ##If Input Off Jump to Tab## if (cmdType == "If Off"): inputIndex = command.find("Input-") tabIndex = command.find("Tab-") inputNum = str(command[inputIndex+6:tabIndex-9]) tabNum = str(command[tabIndex+4:]) command = "JFX"+inputNum+"T"+tabNum+"\n" ser.write(command.encode()) ser.flushInput() time.sleep(.2) value = ser.readline() ************************************************and this with: value = ser.read() if (value == b'F'): index = tab1.progView.get(0, "end").index("Tab Number " + tabNum) index = index-1 tab1.progView.selection_clear(0, END) tab1.progView.select_set(index)