How to create a multiline entry with Tkinter?



Let us suppose that we want to create an Entry widget that supports multiline user input. In order to create a multiline Entry widget, we can use Text() constructor.

Example

Here, in this example, we will create a window that contains a multiline Entry widget.

#Import the library from tkinter import * #Create an object of tkinter window or frame win = Tk() #Define the geometry of window win.geometry("650x250") #Create an instance of Text Widget text = Text(win) text.pack() win.mainloop()

Output

Running the above code will display a window with a text widget that supports multiline user Input.

Updated on: 2021-03-26T10:57:43+05:30

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements