Dev Prakash Sharma has Published 556 Articles

How to select a directory and store the location using Tkinter in Python?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 22-Apr-2021 07:41:07

5K+ Views

We are familiar with dialog boxes and interacted with them in many types of applications. Such types of dialogs are useful in creating an application where user interaction is a prime need. We can use the dialog boxes to ask the user to select different types of files and then ... Read More

How to word-wrap text in Tkinter Text?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 22-Apr-2021 07:40:45

7K+ Views

Word Wrapping plays a significant role in any textual information. It is an important feature for any text editor which breaks the section of a particular text to fit into multiple sections of lines where possible. It is used to fit the content in the width of a text document. ... Read More

Opening and reading a file with askopenfilename in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 22-Apr-2021 07:38:53

2K+ Views

When a user wants to open a file from a directory, the preferred way to do this is to display a popup where the user selects a file to Open. Like most tools and widgets, Tkinter provides us a way to open a dialog for opening a file, reading a ... Read More

Mouse Position in Python Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 22-Apr-2021 07:38:31

7K+ Views

Events are very useful to perform and manage multiple tasks in a large-scale application. We can bind a particular event with the keyboard buttons or mouse buttons using the bind(‘handler’, ‘callback’) method. Generally, the mouse pointer and its motion are tracked for the purpose of building a screensaver, 2D or ... Read More

How to set the font size of a Tkinter Canvas text item?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 22-Apr-2021 07:35:24

4K+ Views

Canvas is one of the flexible widgets in tkinter which controls the widgets with its power of functions, methods, and attributes. However, tkinter canvas can be used to create text using the create_text(options) constructor. We can define the text along with other properties in the constructor. After defining the text, ... Read More

How to set the sticky button property properly?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 22-Apr-2021 07:31:46

1K+ Views

Tkinter Buttons can be configured through the different available attributes and properties in Tkinter. We can add a sticky property to make it sticky relative to the window in which it is residing. The sticky property allows the widget to set the relative position in the window. To make a ... Read More

How to set font for Text in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 22-Apr-2021 07:31:28

8K+ Views

Tkinter has many inbuilt methods and functions which are used to provide different features in the widgets. We can customize the font-property of text widget in a tkinter application using the font(‘font-family’, font-size, ‘style’) attribute. The tuple can be declared inside the Text constructor.ExampleLet us have a look at the ... Read More

How to select at the same time from two Tkinter Listbox?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 22-Apr-2021 07:31:07

2K+ Views

Let us consider a situation for a particular system to keep selecting multiple files from a directory and, once copied in the clipboard, paste them into another directory. The idea of making multiple selections in ListBoxes can be implemented by using the exportselection property. The property prevents the selected options ... Read More

How to reset the background color of a Python Tkinter button?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 22-Apr-2021 07:27:58

2K+ Views

Tkinter buttons are useful for handling events within the application. We can configure the button properties such as text style, font-family, background color, text color, and text size using predefined properties.We can reset the background color and other properties by defining a callback function.Example#Import the tkinter library from tkinter import ... Read More

How to remove the outline of an oval in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 22-Apr-2021 07:25:48

687 Views

With Tkinter canvas, we can draw shapes for 2D or 3D applications, we can create images, draw animation, and many more things. Let us suppose that we have to create an oval that should be drawn aesthetically on the canvas. There can be other features that can be present to ... Read More

Advertisements