tkinter.py 639 B

12345678910111213141516171819202122232425262728293031323334
  1. import tkinter
  2. root = tkinter.Tk()
  3. # specify size of window.
  4. root.geometry("250x170")
  5. # Create text widget and specify size.
  6. T = tk.Text(root, height = 5, width = 52)
  7. # Create label
  8. l = tk.Label(root, text = "Fact of the Day")
  9. l.config(font =("Courier", 14))
  10. Fact = """A man can be arrested in
  11. Italy for wearing a skirt in public."""
  12. # Create button for next text.
  13. b1 = tk.Button(root, text = "Next", )
  14. # Create an Exit button.
  15. b2 = tk.Button(root, text = "Exit",
  16. command = root.destroy)
  17. l.pack()
  18. T.pack()
  19. b1.pack()
  20. b2.pack()
  21. # Insert The Fact.
  22. T.insert(tk.END, Fact)
  23. root.mainloop()