How to get the Tkinter Label text?

Tkinter Labels are used to create and display text or images on the window. It has several components and functions that can be used to customize the label information such as fontfamily, padding, width, height, etc. In order to get the Label text on the window, we can write the value for the text that has to be displayed on the window.


#Import the required library
from tkinter import *

#Create an instance of tkinter frame
win= Tk()

#Define the geometry of the window

#Create a Label with Text
my_text= Label(win, text= "This is a New Line Text", font=('Helvetica bold', 16))

#Print the label text



The above code will display the Label “This is a New Line Text” which can be printed by the print function.

Updated on: 26-Mar-2021

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started