- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to display multiple lines of text in Tkinter Label?
Tkinter Label widgets are created by defining the Label(parent, **options) constructor in the program. We use the Label widget to display Text or Images in any application. If we want to display a text, we have to assign a value to the text attribute in the constructor. You can also add multiple lines of text in the label widget by using \n next line attribute. It will separate the current text to the next line in the Label widget.
Example
# Import the tkinter library from tkinter import * # Create an instance of tkinter frame win= Tk() # Set the size of the Tkinter window win.geometry("700x350") # Add a label widget label= Label(win, text= "Hello There!\n How are you?", font= ('Aerial', 17)) label.pack() win.mainloop()
Output
Executing the above code will display a multiline Label Widget.
- Related Articles
- How to get the Tkinter Label text?
- Display multiple lines of text in a component’s tooltip with Java
- How to align text to the left in Tkinter Label?
- Underline Text in Tkinter Label widget
- How to change Tkinter label text on button press?
- How to justify text in label in tkinter in Python Need justify in tkinter?
- How to change the size of text on a label in Tkinter?
- How to write multiple lines in text file using Python?
- Changing Tkinter Label Text Dynamically using Label.configure()
- How to take input in a text widget and display the text in tkinter?
- How to display multiple labels in one line with Python Tkinter?
- How to read multiple text files from a folder in Python?(Tkinter)
- Python Tkinter – How to display a table editor in a text widget?
- Python Tkinter – How do I change the text size in a label widget?
- How to add Label width in Tkinter?

Advertisements