How to print text into a tkinter window How to print text into a tkinter window tkinter tkinter

How to print text into a tkinter window


import tkinter as tkroot = tk.Tk()# specify size of window.root.geometry("250x170")Create text widget and specify size.T = tk.Text(root, height = 5, width = 52)# Create labell = tk.Label(root, text = "Fact of the Day")l.config(font =("Courier", 14))Fact = """A man can be arrested inItaly for wearing a skirt in public."""# Create button for next text.b1 = tk.Button(root, text = "Next", )# Create an Exit button.b2 = tk.Button(root, text = "Exit",            command = root.destroy) l.pack()T.pack()b1.pack()b2.pack()# Insert The Fact.T.insert(tk.END, Fact)tk.mainloop()