I think what you want is this, it will delete all the text, then insert a variable.
def set_input(value): text.delete(1.0, "END") text.insert("END", value)
Python 2.x only, 3 requires that "END" be END from the Tk namespace.
def set_value(): text.insert("end-1c",value)