Entry Tkinter | Python 3
In this tutorial, we are going to see how to use Entry widget in Tkinter. The Entry widget is used to enter text. This widget allows the user to enter one line of text.
To enter multiple lines of text, use the Text widget.
If you want to display one or more lines of text that cannot be edited by the user, you must use the Label widget.
[st_adsense]
Syntax:
Here is the syntax to create this widget:
e = Entry ( master, option = value, ... )
Parameters:
- master : This represents the parent window.
- options : Options can be used as comma separated key-value pairs. See the following example:
[st_adsense]
Example:
from tkinter import * gui = Tk() l = Label( gui, text = "Enter your age" ) l.pack( side = LEFT ) e = Entry( gui, bd = 5 ) e.pack( side = RIGHT ) gui.mainloop()
Output:
[st_adsense]