import tkinter as tk from tkinter import ttk root = tk.Tk() my_label = ttk.Label(root, text="Hello World!") my_label.pack() root.mainloop()
import tkinter as tk from tkinter import ttk root = tk.Tk() photo = tk.PhotoImage(file="my_image.png") my_label = ttk.Label(root, image=photo) my_label.pack() root.mainloop()In this example, the Python tkinter.ttk Label widget is used to display an image called "my_image.png" on the GUI interface. In conclusion, the Python tkinter.ttk Label widget is a useful tool for displaying text or graphics on a GUI interface. It is a part of the Tkinter module, which is a standard GUI library for Python.