Dev Prakash Sharma has Published 548 Articles

What does the 'tearoff' attribute do in a Tkinter Menu?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Mar-2021 09:04:56

939 Views

Using Tkinter.Menu, we can create menus and submenus. Also, there are some other properties which are used with tkinter menus.Tearoff property makes the menus in the window as tearable. tearoff attribute accepts a Boolean value to separate the menu from the main window or the parent window. With tearoff attribute, ... Read More

Tkinter bell() method

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Mar-2021 09:02:27

716 Views

Tkinter bell() method produces the default event or dialogue sound of the system. This method can be invoked in the default window or frame. We can change the sound of the window by going to the system configuration.In this example, we will create a button that will make the default ... Read More

Ratio Calculator GUI using Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Mar-2021 09:01:23

460 Views

In this article, we will see how to create a functional application that calculates the ratio. In order to make it fully functional, we will use SpinBox method that generally creates an ideal spinner for a value. This value can be modified using the spinner widget in the frame. Thus, ... Read More

Python program to find the sum of sine series

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Mar-2021 08:59:33

2K+ Views

Let us consider that we have a value x and we have to calculate the sum of sine(x) series. In a sine(x) series, there are multiple terms such that, sine(x) = x− x^3/fact(3) + x^5/fact(5) −x^7/fact(7)....In order to solve the particular series-based problem, we will first take the degree as ... Read More

Python program to calculate the number of digits and letters in a string

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Mar-2021 08:57:30

11K+ Views

Let us suppose that we have a string and we have to calculate the total number of digits and letters present in the string.For ExampleInput −s = “tutorialsP0int”Output −Letters: 13 Digits: 1Explanation −Total number of letters and digits present in the given string are 13 and 1.Approach to Solve this ProblemTo calculate ... Read More

On/Off Toggle Button Switch in Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Mar-2021 08:55:37

3K+ Views

Tkinter provides features for adding different kinds of widgets necessary for an application. Some of these widgets are: Button widget, Entry Widget, Text Box, Slider, etc. In this article, we will see how we can create an application with a button such that it can either be on or off.In ... Read More

How to use Unicode and Special Characters in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Mar-2021 08:51:51

1K+ Views

Sometimes we need to add unicode and special charset in our Tkinter application. We can add unicode characters in our labels or widgets concatenating the signature as, u ‘/’. You can find the list of all unicode characters from hereIn this example, we will add a unicode character in the ... Read More

How to use Thread in Tkinter Python?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Mar-2021 08:48:20

7K+ Views

With Tkinter, we can call multiple functions at a time using Threading. It provides asynchronous execution of some functions in an application.In order to use a thread in Python, we can import a module called threading and subclass its Thread class. Inside our new class, we need to overwrite the ... Read More

How to Use Images as Backgrounds in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Mar-2021 08:46:19

9K+ Views

If we will create an instance of Tkinter frame and display the window while keep running it, then it will show the default output canvas. However, we can add an image inside the Tkinter canvas as a background using PhotoImage methods and Canvas methods.Since image support in Tkinter is limited ... Read More

How to use Bitmap images in Button in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Mar-2021 08:45:10

929 Views

In Tkinter, we can create and customize buttons using images. These images can be uploaded by using the Python PhotoImage(file) function.However, PhotoImage() supports only a few image types such as PNG, PPM, and GIF. In addition, we can create buttons using BitMap images too. A bitmap image is nothing but ... Read More

Advertisements