Dev Prakash Sharma has Published 556 Articles

Resizing images with ImageTk.PhotoImage with Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Aug-2021 06:22:43

18K+ Views

The PIL or Pillow library in Python is used for processing images in a Tkinter application. We can use Pillow to open the images, resize them and display in the window. To resize the image, we can use image_resize((width, height) **options) method. The resized image can later be processed and ... Read More

How to change Entry.get() into an integer in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Aug-2021 06:20:46

15K+ Views

The Entry widget in Tkinter is generally used to accept one-line input in the text field. We can get the output from the Entry widget using .get() method. However, the .get() method returns the output in string format. For example, if the user types an integer number in the Entry ... Read More

How to configure default Mouse Double-Click behavior in a Tkinter text widget?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Aug-2021 06:15:17

396 Views

The Text widget in Tkinter is used to add a text editor-like functionality in the application. The Text widget supports multiline user input from the user. We can configure the text widget properties such as its font properties, text color, background, etc., by using the configure() method.The Text widget also ... Read More

How to hide a widget after some time in Python Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Aug-2021 14:48:51

480 Views

Tkinter is a standard Python library for developing GUI-based applications. We can create games, tools, and other applications using the Tkinter library. To develop GUI-based applications, Tkinter provides widgets.Sometimes, there might be a requirement to hide a widget for some time. This can be achieved by using the pack_forget() method. ... Read More

How to change the TKinter canvas line from dash to solid?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Aug-2021 14:46:48

422 Views

Canvas widget is one of the most widely used widgets for graphical representation in a Tkinter application. To display a line in the Canvas widget, we can use the built-in library method create_line(x1, y1, x2, y2, **options).We can also specify the type of line using the dash property. To change ... Read More

How to get the current length of the Text in a Tkinter Text widget?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Aug-2021 14:44:28

2K+ Views

The Text widget in Tkinter supports multiline user input from the user. We can configure the Text widget properties such as its font properties, text color, background, etc., by using the configure() method.To create an application that will count the currently written characters in a Text widget, we can follow ... Read More

How to change the mouse pointer color in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Aug-2021 14:41:19

1K+ Views

Tkinter is a standard Python library for developing GUI-based applications. We can change the properties of its widgets by using the built-in functions and methods. In some applications, the properties affect the mouse pointer as well.Tkinter provides us a way to change the mouse pointer color in the window. To ... Read More

How can I identify when a Button is released in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Aug-2021 14:34:36

2K+ Views

In Tkinter, events are generally called by buttons or keys. Whenever the user presses an assigned key or clicks an assigned button, the events get executed. To execute the events, we can bind a button or a key with the callback function.Consider an application where we need to trigger an ... Read More

How to highlight the current line of a Text widget in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Aug-2021 14:31:36

1K+ Views

We can use the Tkinter text widget to accept multiline user input. We can insert text, display information, and get the output from the text widget.To highlight the currently selected text in a text widget, we can use the tag_add() method that adds a tag in the current text only.Example# ... Read More

How do I print and have user input in a text box in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 05-Aug-2021 14:29:33

8K+ Views

We can use the Tkinter text widget to insert text, display information, and get the output from the text widget. To get the user input in a text widget, we've to use the get() method. Let's take an example to see how it works.Example# Import the required library from tkinter ... Read More

Previous 1 ... 6 7 8 9 10 ... 56 Next
Advertisements