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-
  1. from tkinter import *  
  2. main = Tk()  
  3. var = StringVar()  
  4. label = Label(main, textvariable=var, relief=RAISED )  
  5. var.set("C# corner ")  
  6. label.pack()  
  7. main.mainloop()  
Output-

Summary

In this chapter, you learnt what label widget is and how to use the property of the widget.
Next » Tkinter Widgets-Listbox