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 | Menu widget in Tkinter
- Python | PanedWindow Widget in Tkinter
- Progressbar widget in Tkinter | Python
- Python | Add style to tkinter button
- Python | Add image widget in Kivy
- Python | Textinput widget in kivy
- Python | Popup widget in Kivy
- Python | BoxLayout widget in Kivy
- Python | Switch widget in Kivy
- Python | Slider widget in Kivy
- Python | Checkbox widget in Kivy
- Python | Progress Bar widget in kivy
- Python | Slider widget using .kv file
- Python | Scrollview widget in kivy
- Python | Spinner widget in kivy
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.