Tkinter Label

  • Post category:Tkinter

In this Tkinter tutorial, you will learn how to add the Tkinter label.

# import Tkinter Module
import tkinter as tk

# create main window
var = tk.Tk()

# Set title
var.title("My Tkinter")

# create a label
var2 = tk.Label(var, text="This is a given label")

# pack label
var2.pack()

# start the event loop
var.mainloop()

Output:

Free resources to learn advanced skills: AiHints and CodeAllow