Blog

python tutorials and learn python

Created with Sketch.

How to Schedule an Action with Tkinter after() method

How to Schedule an Action with Tkinter after() method Summary: in this tutorial, you’ll learn how to use the Tkinter after() method to schedule an action after a timeout has elapsed. Introduction to Tkinter after() method All Tkinter widgets have the after() method with the following syntax: widget.after(delay, callback=None) Code language: Python (python) The after()…
Read more

How to Change the Appearances of Widgets Dynamically Using Ttk Style map() Method

How to Change the Appearances of Widgets Dynamically Using Ttk Style map() Method Summary: in this tutorial, you’ll learn how to use the ttk Style map() method to dynamically change the appearance of a widget based on its specific state. Typically, a ttk widget allows you to change its appearance based on a specific state.…
Read more

Ttk Elements

Ttk Elements   Summary: in this tutorial, you’ll learn about the ttk elements and how they are assembled into styles of widgets. Introduction to ttk elements So far, you have learned that a theme is a collection of styles that defines the appearance of all ttk widgets. A style is a description of the appearance…
Read more

Ttk Styles

Ttk Styles   Summary: in this tutorial, you’ll learn about the ttk styles, how to use and customize the widget’s styles, and how to change the appearance of a widget by extending the built-in styles. Introduction to the ttk styles A theme of a collection of styles that determine the appearances of ttk widgets. A…
Read more

Tkinter Themes

Tkinter Themes   Summary: in this tutorial, you’ll learn how to change the Tkinter theme from one to another. Introduction to Tkinter ttk themes In Tkinter, a theme determines the “look & feel” of all the widgets. It’s a collection of styles for all the ttk widgets. A style specifies the appearance of a widget…
Read more

Tkinter OptionMenu

Tkinter OptionMenu   Summary: in this tutorial, you’ll learn about the Tkinter OptionMenu widget to display a set of options in a drop-down menu. Introduction to the Tkinter OptionMenu widget The OptionMenu widget provides you with a predefined set of options in a drop-down menu. To create a new OptionMenu widget, you use the OptionMenu…
Read more

Tkinter Menubutton

Tkinter Menubutton   Summary: in this tutorial, you’ll learn how to use the Tkinter Menubutton widget. Introduction to the Menubutton widget A Menubutton widget is a combination of a Button and a Menu widget. When you click the Menubutton, it shows a menu with choices. For example: To create a Menubutton widget, you follow these…
Read more

Tkinter Menu

Tkinter Menu   Summary: in this tutorial, you’ll learn how to create a Tkinter menu bar, add menus to the menu bar, and add menu items to each menu. When an application contains a lot of functions, you need to use menus to organize them for easier navigation. Typically, you use a menu to group…
Read more

Tkinter Color Chooser

Tkinter Color Chooser   Summary: in this tutorial, you’ll learn how to display a color chooser dialog using the askcolor() function from the tkinter.colorchooser module. Introduction to the Tkinter color chooser dialog To display a native color chooser dialog, you use the tkinter.colorchooser module. First, import the askcolor() function from the tkinter.colorchooser module: from tkinter.colorchooser…
Read more

Tkinter Open File Dialog

Tkinter Open File Dialog   Summary: in this tutorial, you’ll learn how to show an open file dialog in Tkinter applications. Introduction to the Tkinter Open File Dialog functions When developing a Tkinter application that deals with the file system, you need to provide a dialog that allows file selections. To do that, you can…
Read more