1import tkinter as tk
2root = tk.Tk()
3root.geometry("400x240")
4
5def getTextInput():
6 result=textExample.get("1.0","end")
7 print(result)
8
9textExample=tk.Text(root, height=10)
10textExample.pack()
11btnRead=tk.Button(root, height=1, width=10, text="Read",
12 command=getTextInput)
13
14btnRead.pack()
15
16root.mainloop()