Python offers multiple options for developing GUI (Graphical User Interface).
Out of all the GUI methods, tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python. Python with tkinter is the fastest and easiest way to create the GUI applications. Creating a GUI using tkinter is an easy task. When you execute the above code, a new window pops up on your screen.
Widgets are the bread and butter of the Python GUI framework Tkinter. They are the elements through which users interact with your program. Each widget in Tkinter is defined by a class.
Here are some of the widgets available:
Widget Class | Description |
---|---|
Label | Widget used to display text on the screen. |
Button | Button that can contain text and can perform an action when clicked. |
Entry | Text entry widget that allows only a single line of text. |
Text | Text entry widget that allows multiline text entry. |
Frame | Rectangular region used to group related widgets or provide padding between widgets. |