Dev Prakash Sharma has Published 548 Articles

Difference between import tkinter as tk and from tkinter import

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 15-Apr-2021 13:23:42

5K+ Views

In order to work with tkinter applications and widgets, we have to import the tkinter library in the environment. There are multiple ways to import the tkinter library in the notebook.Using from tkinter import *Using import tkinter as tkThe first method to import the tkinter library is the most common, ... Read More

Difference between "fill" and "expand" options for tkinter pack method

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 15-Apr-2021 13:19:17

4K+ Views

Tkinter Pack Manager acts based on using the extra space within the parent widget. While packing a widget, we can specify whether the widget should shrink or fill in the entire screen. In order to enable the widget to grow in the entire window, we can use the 'fill' property. ... Read More

Creating a popup message box with an Entry field in tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 15-Apr-2021 13:17:44

7K+ Views

Tkinter Popup are toplevel window interfaces that wrap up the widget and the element with the main window. It can be embedded in any main window using a handler like Button Widget. Popup can be created using the Toplevel(root) constructor.ExampleIn this example, we will create a simple application containing a ... Read More

Change the focus from one Text widget to another in Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 15-Apr-2021 13:13:45

1K+ Views

In various applications, tkinter widgets are required to be focused to make them active. Widgets can also grab focus and prevent the other events outside the bounds. To manage and give focus to a particular widget, we generally use the focus_set() method. It focuses the widget and makes them active ... Read More

Change command Method for Tkinter Button in Python

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 15-Apr-2021 13:11:16

5K+ Views

The significance of Button widget is that it is used for handling events to perform certain operations in the application. In order to handle such events, we generally define a method which contains certain operations.Let us suppose we want to change the event method after initializing the button. We can configure ... Read More

Adding a scrollbar to a group of widgets in Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 15-Apr-2021 13:08:31

723 Views

Let’s suppose you want to add a scrollbar to a group of widgets in an application, then you can use the Scrollbars property in tkinter. Adding Scrollbars to a group of widgets can be achieved by Scrollbar(....options).ExampleIn this example, we will define a group of Listbox widgets and then add ... Read More

Add advanced features to a tkinter Text widget

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 15-Apr-2021 13:06:12

697 Views

Tkinter text widget is much more than just a multiline text editor. It is useful for many applications where user interaction is required.In order to configure the text widget, tkinter provides many functions and methods. Some of the features that we can add to style the text widgets are: changing ... Read More

Difference between tkinter and Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 27-Mar-2021 06:30:05

1K+ Views

In order to install tkinter in a local computer, we use several commands on the basis of our OS architecture. There are two ways to import the tkinter library in our Window-based machine which are based on the Python version. Earlier, for lower versions of Python, we generally used to ... Read More

Display message when hovering over something with mouse cursor in Tkinter Python

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 27-Mar-2021 06:29:42

5K+ Views

Let us suppose we want to create an application where we want to add some description on tkinter widgets such that it displays tooltip text while hovering on the button widget. It can be achieved by adding a tooltip or popup.Tooltips are useful in applications where User Interaction is required. ... Read More

Draw a circle in using Tkinter Python

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 27-Mar-2021 06:29:22

17K+ Views

Tkinter Canvas are generally used for creating shapes such as arc, rectangle, triangle, freeform shapes, etc. All these shapes can be drawn using the inbuilt function available in tkinter library.ExampleIn this example, we will create a Circle using the create_oval(x0, y0, x1, y1) method by passing the following values of ... Read More

Advertisements