Tkinter is a GUI (Graphical User Interface) module which is widely used to create GUI applications. It comes along with the Python itself.
Entry widgets are used to get the entry from the user. It can be created as follows-
entry = ttk.Entry(master, option = value, ...)
Code #1: Creating Entry widget and taking input from user (taking only String data).
In above output, as soon as you run the code a Tkinter window will appear and Entry widget is already focussed that means we don’t have to give focus to the Entry area.
When we press Button a confirmation message will appear, saying whether you want to save the text or not (it will not save the text, it is only used to show the functioning of Button).
Code #2: Adding Style to the entered text in Entry widget.
In the above output, you may notice that the color of the font is changed, font family is changed, size of the text is bigger than normal as well as text is written in bold. This is because we are adding style to the input text.
- Python Tkinter - Text Widget
- Create Find and Replace features in Tkinter Text Widget
- Change the color of certain words in the tkinter text widget
- Python | Menu widget in Tkinter
- Progressbar widget in Tkinter | Python
- Python | PanedWindow Widget in Tkinter
- Python Tkinter - Toplevel Widget
- Combobox Widget in tkinter | Python
- Python Tkinter - Entry Widget
- Python Tkinter - Checkbutton Widget
- Python Tkinter - ListBox Widget
- Python Tkinter - Scale Widget
- Python Tkinter - Canvas Widget
- Python Tkinter - MessageBox Widget
- Python Tkinter - Menubutton Widget
- Python Tkinter - Frame Widget
- Creating Tabbed Widget With Python-Tkinter
- Python Tkinter - Validating Entry Widget
- Tkinter - Read only Entry Widget
- Python Tkinter - ScrolledText Widget
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.