Python tkinter Module
Example
Create a simple GUI window:
import tkinter as tk
print('tkinter is available')
print('Standard GUI toolkit for Python')
Try it Yourself »
Definition and Usage
The tkinter module is Python's standard GUI (Graphical User Interface) toolkit based on Tk.
Use it to create desktop applications with windows, buttons, menus, and other graphical elements.
Tip: Learn Tkinter step by step in our Python Tkinter Tutorial.
Members
| Member | Description |
|---|---|
| BooleanVar | Variable that holds True or False, for example for a Checkbutton. |
| Button | Widget for clickable buttons. |
| Canvas | Widget for drawing graphics. |
| Checkbutton | Widget for a check box that can be turned on and off. |
| Combobox | ttk widget for a drop-down list of values. |
| Entry | Widget for single-line text input. |
| Frame | Container widget for organizing other widgets. |
| Label | Widget for displaying text or images. |
| Listbox | Widget for displaying a list of items. |
| Menu | Widget for creating menus. |
| messagebox | Module for message boxes and yes or no questions. |
| Progressbar | ttk widget that shows how far a task has come. |
| Radiobutton | Widget for choosing one of several options. |
| StringVar | Variable that holds a string, for example for a group of Radiobuttons. |
| Text | Widget for multi-line text input/display. |
| Tk | Class for creating the main application window. |
| ttk | Module with themed widgets that look like the operating system. |