Dev Prakash Sharma has Published 556 Articles

How to close a Tkinter window by pressing a Button?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 11:01:23

1K+ Views

Tkinter initially creates a window or frame that contains widgets and Labels within it. Let us suppose we want to close the tkinter window with a button. A Button is a UI widget that can be used to perform a certain operation.ExampleHere, we will create a button that closes the ... Read More

How to create a download progress bar in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 11:00:08

1K+ Views

Let’s suppose that we are creating an application which interacts with sources and files such as downloading the files, tracking the file. In order to make a progressbar for such an application, we will use the tkinter.ttk package that includes the Progressbar module.Initially, we will instantiate an object of Progressbar ... Read More

How to create a multiline entry with Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:57:43

1K+ Views

Let us suppose that we want to create an Entry widget that supports multiline user input. In order to create a multiline Entry widget, we can use Text() constructor.ExampleHere, in this example, we will create a window that contains a multiline Entry widget.#Import the library from tkinter import * ... Read More

How to create a password entry field using Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:57:10

5K+ Views

Let us suppose we want to add an Entry widget which accepts user passwords. Generally, the passwords are displayed using “*” which yields to make the user credentials in an encrypted form.We can create a password field using tkinter Entry widget.ExampleIn this example, we have created an application window that ... Read More

How to delete Tkinter widgets from a window?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:54:36

7K+ Views

Sometimes, we want to remove a widget that is of no use in the application. We can delete widgets from the window or frame using the .destroy method in tkinter. It can be invoked in the widget by defining a function for it.ExampleIn this example, we have created a button ... Read More

How to display full-screen mode on Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:51:08

12K+ Views

Tkinter displays the application window by its default size. However, we can display a full-screen window by using attributes('fullscreen', True) method. The method is generally used for assigning a tkinter window with properties like transparentcolor,  alpha, disabled, fullscreen, toolwindow, and topmost.Example#Import the tkinter library from tkinter import * #Create ... Read More

How to get the screen size in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:48:33

17K+ Views

Tkinter initially creates a window or frame object where all the widgets, frame are displayed.Tkinter components adjust the window size and width according to user-defined geometry.In order to get the screen size, we can use winfo_screenwidth() which returns the screen width and winfo_screenheight() for the height of the screen in ... Read More

How to get the Tkinter Label text?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:48:08

2K+ Views

Tkinter Labels are used to create and display text or images on the window. It has several components and functions that can be used to customize the label information such as fontfamily, padding, width, height, etc. In order to get the Label text on the window, we can write the ... Read More

How to install Tkinter for Python on Linux?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:46:32

14K+ Views

Tkinter is one of the widely used libraries for creating GUI-based applications. In order to create applications using Tkinter, we have to install and import the library in the notebook.First, we have to install the tkinter library in our local environment based on the Windows or Linux operating system.For Windows ... Read More

How to make a Tkinter widget invisible?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 26-Mar-2021 10:42:38

4K+ Views

To make a tkinter widget invisible, we can use the pack_forget() method. It is generally used to unmap the widgets from the window.ExampleIn the following example, we will create a label text and a button that can be used to trigger the invisible event on the label text widget.#Import the ... Read More

Advertisements