Tkinter.Text.compare

Text.compare(index1, op, index2)[source]

Return whether between index INDEX1 and index INDEX2 the relation OP is satisfied. OP is one of <, <=, ==, >=, >, or !=.