Python Articles

Page 11 of 855

How to set to see the end of text in Tkinter Entry widget?

Gaurav Leekha
Gaurav Leekha
Updated on 27-Mar-2026 1K+ Views

Tkinter, the de facto standard GUI (Graphical User Interface) toolkit for Python, provides a versatile set of tools for creating desktop applications. One common widget used for user input is the Entry widget, which allows users to input a single line of text. However, when dealing with longer strings that extend beyond the visible area of the widget, users may face the challenge of efficiently navigating to the end of the text. In this article, we'll explore techniques to achieve just that. What is Tkinter Entry Widget? The Entry widget in Tkinter is a fundamental tool for ...

Read More

How to set maximum width in characters for the Text widget in Tkinter?

Gaurav Leekha
Gaurav Leekha
Updated on 27-Mar-2026 2K+ Views

Graphical User Interfaces (GUIs) play a crucial role in modern software applications, providing users with an interactive and visually appealing experience. Tkinter, Python's standard GUI toolkit, simplifies the process of creating GUI applications. One common task in GUI development is controlling the width of text display areas, such as those provided by the Text widget in Tkinter. In Tkinter, the Text widget is a versatile tool for displaying and editing text. However, managing the width of this widget can be tricky, especially when you want to set a maximum width to control the layout of your application. In this ...

Read More

How to run Specific function automatically or infinite times in Python Tkinter?

Gaurav Leekha
Gaurav Leekha
Updated on 27-Mar-2026 3K+ Views

When creating graphical user interfaces with Python's Tkinter library, you often need to run specific functions automatically at regular intervals. This is useful for updating displays, handling periodic tasks, or refreshing data. Python Tkinter provides several approaches to achieve automatic function execution. Understanding the Tkinter Event Loop Tkinter applications are event-driven, meaning they continuously listen for events like button clicks or keyboard inputs. The event loop runs indefinitely using mainloop(), constantly checking for events and executing appropriate handlers. To run functions automatically within this event loop, we have three main approaches: Using the after() method ...

Read More

How to rotate text around (or inside) a circle in Tkinter?

Gaurav Leekha
Gaurav Leekha
Updated on 27-Mar-2026 2K+ Views

In graphical user interface (GUI) design, the ability to rotate text along a circular path adds a dynamic and visually appealing element to applications. Tkinter, the popular Python library for GUI development, provides robust features to achieve text rotation along a circular path and change its orientation. In this article, we will explore how to rotate text along a circular path in Tkinter and provide a complete Python implementation to demonstrate this technique. Understanding Text Rotation along a Circular Path in Tkinter In Tkinter, rotating text along a circular path involves utilizing the create_text() method of the canvas ...

Read More

How to Retrieve Text from a ScrolledText Widget in Tkinter?

Gaurav Leekha
Gaurav Leekha
Updated on 27-Mar-2026 3K+ Views

Tkinter, a popular Python library for creating graphical user interfaces (GUI), provides a wide range of widgets to build interactive applications. Among these widgets, the ScrolledText widget is commonly used to display and enter multiline text with scrolling capabilities. If you're working with a ScrolledText widget in Tkinter and need to extract the entered or existing text, this article will guide you through the process. Basic Text Retrieval To begin, let's create a simple Tkinter application that includes a ScrolledText widget ? Example import tkinter as tk from tkinter import scrolledtext def get_text(): ...

Read More

How to retrieve copied file name with Tkinter?

Gaurav Leekha
Gaurav Leekha
Updated on 27-Mar-2026 324 Views

Tkinter, the standard GUI toolkit for Python, provides a versatile set of tools for creating graphical user interfaces. In this article, we'll explore the process of retrieving the name of a file that has been copied to the clipboard using Tkinter. We will provide clear, step-by-step instructions and a complete implementation example. Before starting our implementation, it's important to understand how Tkinter interacts with the clipboard. How Tkinter Works with Clipboard Tkinter provides a convenient way to interact with the clipboard, allowing developers to retrieve and manipulate data that users have copied or cut. The tkinter.Tk class ...

Read More

How to remove white space from a Python\'s Tkinter canvas?

Gaurav Leekha
Gaurav Leekha
Updated on 27-Mar-2026 981 Views

One of the essential components in Tkinter is the canvas, which allows for drawing and displaying graphics, shapes, and images. However, when working with a canvas, you might encounter a common issue: white space surrounding the drawn elements. This white space can affect the aesthetics and layout of your GUI. In this article, we will explore different techniques to remove white space from a Tkinter canvas and achieve a clean and visually appealing interface. Understanding the White Space Issue in Tkinter Canvas Before we delve into the solutions, let's understand why white space appears in a Tkinter ...

Read More

How to remember tkinter window position in python 3?

Gaurav Leekha
Gaurav Leekha
Updated on 27-Mar-2026 915 Views

Tkinter is a popular GUI (Graphical User Interface) toolkit for Python that provides developers with a set of tools and widgets to create desktop applications. When designing user-friendly applications, it is crucial to consider the user's preferences and provide a seamless experience. One aspect of this is remembering the position of the application window. By saving and restoring the window position, you can ensure that the application always opens in the desired location. To remember the window position in Tkinter, we need to store the coordinates of the window when it is closed and retrieve them when the application ...

Read More

How to pass a 2D array from one class to another in Tkinter?

Gaurav Leekha
Gaurav Leekha
Updated on 27-Mar-2026 343 Views

Tkinter, the standard GUI library for Python, provides a powerful framework for building graphical user interfaces. When developing complex applications, it often becomes necessary to pass data between different classes or components. In this article, we will explore the process of passing a 2D array from one class to another in Tkinter with three different approaches. Consider a common scenario where we have a Tkinter application with two classes: ClassA and ClassB. ClassA contains a 2D array, and we want to pass this array to ClassB to perform operations or display the data. Approach 1: Passing Through Constructor ...

Read More

How to modify tags in Tkinter Canvas by events?

Gaurav Leekha
Gaurav Leekha
Updated on 27-Mar-2026 2K+ Views

The Tkinter library in Python provides a powerful Canvas widget for creating graphical user interfaces. The Canvas widget allows you to draw shapes, images, and text on a customizable surface. Tags are used to group and manipulate canvas objects as a whole. In this article, we will explore how to modify tags in Tkinter Canvas by events. We will provide a step-by-step guide and a complete implementation example to demonstrate this process. Understanding Tags in Tkinter Canvas Tags in Tkinter Canvas are identifiers assigned to one or more objects on the canvas. They allow you to manipulate ...

Read More
Showing 101–110 of 8,549 articles
« Prev 1 9 10 11 12 13 855 Next »
Advertisements