Kiran Kumar Panigrahi has Published 426 Articles

How to align checkbutton in ttk to the left side?

Kiran Kumar Panigrahi

Kiran Kumar Panigrahi

Updated on 26-Oct-2021 13:33:15

3K+ Views

To align the checkbuttons to left, you can use the anchor parameter and set it to "w" (west). Let's take an example and see how to do it.Steps −Import the tkinter library and create an instance of tkinter frame.Set the size of the frame using geometry method.Create a LabelFrame to ... Read More

How to exit from Python using a Tkinter Button?

Kiran Kumar Panigrahi

Kiran Kumar Panigrahi

Updated on 26-Oct-2021 13:29:39

20K+ Views

To exit from Python using a Tkinter button, you can follow the steps given below −Steps −Import the tkinter library and create an instance of tkinter frame.Set the size of the frame using geometry method.Define a function close() to close the window. Call the method win.destroy() inside close().Next, create a ... Read More

Tkinter-How to get the current date to display in a tkinter window?

Kiran Kumar Panigrahi

Kiran Kumar Panigrahi

Updated on 26-Oct-2021 13:24:01

6K+ Views

To display the current date in tkinter window, we will use the datetime library.date = dt.datetime.now()Steps −Import the required libraries and create an instance of tkinter frame.Set the size of the frame using geometry method.Call datetime.now() and store the value in a variable "date".Next, create a label to display the ... Read More

How to display multiple labels in one line with Python Tkinter?

Kiran Kumar Panigrahi

Kiran Kumar Panigrahi

Updated on 26-Oct-2021 13:18:11

5K+ Views

To display multiple labels in one line with Python Tkinter, we can use the pack() method of label and align all the labels to the same side. Let's take an example and see how to display multiple labels in one line.Steps −Import the required libraries and create an instance of ... Read More

Creating an automatically maximized tkinter window

Kiran Kumar Panigrahi

Kiran Kumar Panigrahi

Updated on 26-Oct-2021 13:14:28

2K+ Views

There are two different ways in which we can get an automatically maximized window in Tkinter.We can use the state() method of Tkinter and invoke it with the attribute "zoomed".root.state("zoomed")The second approach is to use the attributes method of Tkinter with the parameter "-fullscreen" and set it to True.By default, ... Read More

Tkinter - How to put an outline on a canvas text

Kiran Kumar Panigrahi

Kiran Kumar Panigrahi

Updated on 26-Oct-2021 13:07:32

2K+ Views

The create_text method of Canvas widget in Tkinter doesn't have an attribute like "outline" or "border" to set an outline around a text object. So, to put an outline on a canvas text, you can follow the steps given below −Steps −Import the required libraries and create an instance of ... Read More

How to draw an arc on a tkinter canvas?

Kiran Kumar Panigrahi

Kiran Kumar Panigrahi

Updated on 26-Oct-2021 12:58:44

5K+ Views

The Canvas is a rectangular area intended for drawing pictures or other complex layouts. You can place graphics, text, widgets or frames on a Canvas.To draw an arc on a tkinter Canvas, we will use the create_arc() method of the Canvas and supply it with a set of coordinates to ... Read More

How to get rid of widget border in Tkinter?

Kiran Kumar Panigrahi

Kiran Kumar Panigrahi

Updated on 26-Oct-2021 12:55:08

9K+ Views

Tkinter comes with different types of widgets such as Button, Entry, Frame, Label, Radiobutton, Scrollbar, etc. Widgets are standard graphical user interface (GUI) elements that display information or help users interact with the system.In this example, we will see how to get rid of the border from a canvas, Entry ... Read More

Embedding an Image in a Tkinter Canvas widget using PIL

Kiran Kumar Panigrahi

Kiran Kumar Panigrahi

Updated on 26-Oct-2021 12:51:09

2K+ Views

The Pillow library in Python contains all the basic image processing functionality. It is an open-source library available in Python that adds support to load, process, and manipulate the images of different formats.Let's take a simple example and see how to embed an Image in a Tkinter canvas using Pillow ... Read More

How to run an infinite loop in Tkinter?

Kiran Kumar Panigrahi

Kiran Kumar Panigrahi

Updated on 26-Oct-2021 12:48:38

7K+ Views

To run an infinite loop in Tkinter, we will use the after method to call a method recursively after a specified time period until the user decides to stop the loop. Let's take a simple example and see how to start and stop an infinite loop.Steps −Import the required libraries ... Read More

Advertisements