To clear the entire text in a text widget, use the .delete() method.
my_text_widget.delete("1.0", tk.END)
If the text widget is disabled, deleting the contents won't work. We would need to change the state to normal first.
1 2 3 4 5 6 |
|
tk.Text – Clear text contents
To clear the entire text in a text widget, use the .delete() method.
my_text_widget.delete("1.0", tk.END)
If the text widget is disabled, deleting the contents won't work. We would need to change the state to normal first.
1 2 3 4 5 6 |
|