I am writing a script that will take an input from a Tkinter GUI with 2 Entry widgets and a Text widget.
This is just part of my code:
root = Tk()
...
text = Text(root)
root.mainloop()
What I need is to get all the contents of the Text widget.
I am writing a script that will take an input from a Tkinter GUI with 2 Entry widgets and a Text widget.
This is just part of my code:
root = Tk()
...
text = Text(root)
root.mainloop()
What I need is to get all the contents of the Text widget.
To read the entire contents of a Text widget, use
text.get("1.0", "end-1c")
Note that with "end-1c" you get exactly what the user typed without the trailing newline automatically added by the widget.