Python/Tkinter: How to set text widget contents to the value of a variable? Python/Tkinter: How to set text widget contents to the value of a variable? tkinter tkinter

Python/Tkinter: How to set text widget contents to the value of a variable?


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)