Dev Prakash Sharma has Published 556 Articles

How to center an image in canvas Python Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-Mar-2021 13:56:43

4K+ Views

Let us consider that we are creating a GUI-based application using Tkinter and we want to load an image in the Tkinter canvas.By default, the canvas loads the images according to its width and height. However, we can manipulate the position of an image in any direction (N, S, E, ... Read More

How to add placeholder to an Entry in tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-Mar-2021 13:55:10

5K+ Views

Tkinter provides features to add widgets such as button, text, entry, dialogue and other attributes that help to develop an application. However, tkinter doesn't include a placeholder in the entry widget. Placeholders are the dummy text that appears in the entry widget to inform the user about it.In this article, ... Read More

How to add padding to a tkinter widget only on one side?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-Mar-2021 13:53:53

6K+ Views

Let us suppose that we want to add padding on one side (either top/bottom or left/right) of a particular widget. We can achieve this in Tkinter by using its pack() and grid() methods.In pack() method, we have to define the value for “padx” and “pady”. On the other hand, the ... Read More

How do you run your own code alongside Tkinter's event loop?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-Mar-2021 13:52:39

1K+ Views

Tkinter is widely used to create and develop GUI based applications and games. Tkinter provides its window or frame where we execute our programs and functions along with other attributes.Let us consider that we are working with a particular application and we want to write the changes in the code ... Read More

How do I get rid of the Python Tkinter root window?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-Mar-2021 13:50:14

8K+ Views

Sometimes, while testing a Tkinter application, we may need to hide the Tkinter default window or frame. There are two general methods through which we can either hide our Tkinter window, or destroy it.The mainloop() keeps running the Tkinter window until it is not closed by external events. In order ... Read More

How do I close a tkinter window?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-Mar-2021 13:46:19

12K+ Views

Creating an application using tkinter is easy but sometimes, it becomes difficult to close the window or the frame without closing it through the button on the title bar. In such cases, we can use the .destroy() method to close the window.As tkinter attributes are independent of each other, we ... Read More

Good example of functional testing a Python Tkinter application

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-Mar-2021 13:43:10

2K+ Views

Let us suppose that we have a GUI-based Python tkinter application that takes the text input from the user and validates by saving it in a new text file. The file contains the same text input that the user has typed. We can check and validate the user input from ... Read More

Dynamically Resize Buttons When Resizing a Window using Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-Mar-2021 13:40:59

1K+ Views

Python has many rich libraries for creating and developing GUI-based applications. Tkinter is one of the most commonly used Python libraries for creating GUI-based applications. It has many features like adding widgets and other necessary attributes necessary for creating an application.A button is a widget which can be assigned for ... Read More

Creating a Transparent window in Python Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-Mar-2021 13:39:00

791 Views

Python is the most popular language for developing and creating functional and desktop applications. It has a rich library of different modules and functions which provides extensibility and accessibility to create and develop applications.Tkinter is the most commonly used library for creating GUI-based applications. It has features like adding widgets ... Read More

Creating a Frameless window in Python Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-Mar-2021 13:37:48

3K+ Views

Tkinter is the most commonly used Python library for creating GUI-based applications. It has features like adding widgets and other necessary attributes.Let us suppose that we want to create a borderless window using tkinter. To create a borderless window, we can use the overrideredirect method which basically disables the window ... Read More

Advertisements