Category: New Python tutorial

python tutorials and learn python

Created with Sketch.

Python Unit Testing

Python Unit Testing In this section, you’ll learn about unit testing in Python by using the unittest modules to make your code more robust. What you’ll learn: Write effective test cases using the unittest module Run unit tests fast Skip tests unconditionally and conditionally Using test doubles including mocks, stubs, and fakes Parameterize tests Generate…
Read more

Tkinter Matplotlib

Tkinter Matplotlib Summary: in this tutorial, you’ll learn how to display a graph from the Matplotlib library on a Tkinter application. Display a bar chart from matplotlib in Tkinter applications Matplotlib is a third-party library for creating professional visualizations in Python. Since Matplotlib is a third-party library, you need to install it before use. To…
Read more

Tkinter Validation

Tkinter Validation Summary: in this tutorial, you’ll learn how to use the Tkinter validation to validate user inputs. Introduction to the Tkinter validation Tkinter validation relies on the three options that you can use for any input widget such as Entry widget: validate: specifies which type of event will trigger the validation. validatecommand: checks if…
Read more

Tkinter MVC

Tkinter MVC Summary: in this tutorial, you’ll learn how to structure a Tkinter application using the model-view-controller (MVC) pattern. Introduction to Tkinter MVC As your application grows, its complexity also increases. To make the application more manageable, you can use the model-view-controller design pattern. The MVC design pattern allows you to divide the application into…
Read more

How to Display a Progress Bar while a Thread is Running in Tkinter

How to Display a Progress Bar while a Thread is Running in Tkinter Summary: in this tutorial, you’ll learn to display a progressbar while a thread is running in a Tkinter application. This tutorial assumes that you know how to use the after() method and understand how threadings work in Python. Also, you should know…
Read more

Tkinter Thread

Tkinter Thread Summary: in this tutorial, you’ll learn how to use multiple threads in Tkinter applications to make the applications more responsive. When to use Thread in Tkinter applications In a Tkinter application, the main loop should always start in the main thread. It’s responsible for handling events and updating the GUI. If you have…
Read more

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