Category: New Python tutorial

python tutorials and learn python

Created with Sketch.

Switching between Frames Using the Frame tkraise() Method

Switching between Frames Using the Frame tkraise() Method Summary: in this tutorial, you’ll learn how to use the Frame tkraise() method to switch between frames in a Tkinter application. Introduction to the Frame tkraise() method Typically, a Tkinter application consists of multiple frames. And you often need to switch between frames to display the one…
Read more

Developing a Full Tkinter Object-Oriented Application

Developing a Full Tkinter Object-Oriented Application     Summary: in this tutorial, you’ll learn how to develop a full Tkinter object-oriented application. You’ll convert the temperature converter application to a new one that uses object-oriented programming approach: First, define a class called TemperatureConverter. The class has one static method that converts a temperature from Fahrenheit…
Read more

Tkinter Object-Oriented Window

Tkinter Object-Oriented Window Summary: in this tutorial, you’ll learn how to apply object-oriented programming in Tkinter to make the code more organized. Defining a Tkinter object-oriented window The following simple program creates a root window and displays it on the screen: import tkinter as tk root = tk.Tk() root.mainloop() Code language: Python (python) When the…
Read more

Tkinter Object-Oriented Frames

Tkinter Object-Oriented Frames Summary: in this tutorial, you’ll learn how to inherit from the ttk.Frame class and use it in the root window. In the previous tutorial, you’ve learned how to subclass the Tkinter.Tk class. However, a Tkinter application should have only one Tk instance. Therefore, it’s common to inherit from the ttk.Frame class and…
Read more

Tkinter Example

Tkinter Example Summary: in this tutorial, you’ll learn how to build a Tkinter temperature converter application. Introduction to the Temperature Converter application The following shows the Temperature Converter application that you’re going to build. The application converts a temperature from Fahrenheit to Celsius: Basically, the application has a label, an entry, and a button. When…
Read more

Tkinter Frame

Tkinter Frame Summary: in this tutorial, you’ll learn about the Tkinter frame and how to manipulate its attributes including sizes, paddings, and borders. Introduction to Tkinter Frame A frame is a widget that displays as a simple rectangle. Typically, you use a frame to organize other widgets both visually and at the coding level. To…
Read more

Tkinter Treeview

Tkinter Treeview Summary: in this tutorial, you’ll learn about the Tkinter Treeview widget and how to use it to display both tabular and hierarchical data. Introduction to the Tkinter Treeview widget A Treeview widget allows you to display data in both tabular and hierarchical structures. To create a Treeview widget, you use the ttk.Treeview class:…
Read more

Tkinter Notebook

Tkinter Notebook Summary: in this tutorial, you’ll learn how to use the Tkinter Notebook widget to create tabs. Introduction to the Tkinter Notebook widget The Notebook widget allows you to select pages of contents by clicking on tabs: When you click one of these tabs, the Notebook widget will display a child pane associated with…
Read more

Tkinter Progressbar

Tkinter Progressbar Summary: in this tutorial, you’ll learn about the Tkinter Progressbar widget. Introduction to the Tkinter Progressbar widget A Progressbar widget allows you to give feedback to the user about the progress of a long-running task. To create a Progressbar widget, you use the ttk.Progressbar class: ttk.Progressbar(container, **options) Code language: Python (python) The following…
Read more

Tkinter LabelFrame

Tkinter LabelFrame Summary: in this tutorial, you’ll how to use the Tkinter LabelFrame widget that contains other widgets. Introduction to the Tkinter LabelFrame Tkinter LabelFrame widget is a container that contains other related widgets. For example, you can group Radiobutton widgets and place the group on a LabelFrame. To create a LabelFrame widget, you use…
Read more