Tkinter widget -Label
Label widget is only used to display the text on the Application and we also update the text of label.
Syntax-
w = Label ( master, option, ... )
Parameter-
Main- parent Window.
Option- attribute of button widget.
Example-
- from tkinter import *
- main = Tk()
- var = StringVar()
- label = Label(main, textvariable=var, relief=RAISED )
- var.set("C# corner ")
- label.pack()
- main.mainloop()
Output-
Summary
In this chapter, you learnt what label widget is and how to use the property of the widget.