GUI-Programming Articles

Found 242 articles

How to disable column resizing in a Treeview widget in Tkinter?

Gaurav Leekha
Gaurav Leekha
Updated on 05-Dec-2023 3K+ Views

The Treeview widget in Tkinter provides a powerful and versatile way to display hierarchical data in a tabular format. By default, users can resize the columns in a Treeview widget, which can affect the visual layout and disrupt the intended design. In certain cases, you may want to disable column resizing to maintain consistency and control over the widget's appearance. In this article, we will explore techniques to disable column resizing in a Treeview widget in Tkinter, allowing you to create a more controlled and user-friendly interface. Understanding Treeview Column Resizing The Treeview widget in Tkinter allows users to ...

Read More

How to resize an Entry Box by height in Tkinter?

Dev Prakash Sharma
Dev Prakash Sharma
Updated on 04-Oct-2023 38K+ Views

An Entry widget in a Tkinter application supports singleline user inputs. You can configure the size of an Entry widget such as its width using the width property. However, tkinter has no height property to set the height of an Entry widget. To set the height, you can use the font('font_name', font-size) property. The font size of the text in an Entry widget always works as a height of the Entry widget.ExampleLet us take an example to understand this more clearly. Follow the steps given below −Import the required librariesCreate an Entry widget, set its width and height by specifying ...

Read More

How to handle a Button click event in Tkinter?

Dev Prakash Sharma
Dev Prakash Sharma
Updated on 14-Sep-2023 41K+ Views

Sometimes, handling events in a Tkinter application can become a daunting task for us. We have to manage the action and events which need to be executed at the time of running the application. The Button widget is useful for handling such events. We can use Button widget to perform a certain task or event by passing the callback in the command.While giving the command to the Button widget, we can have an optional lambda or anonymous functions which interpret to ignore any errors in the program. These are just like a general function but they don't have any function ...

Read More

How to get the longitude and latitude of a city using Python?

Kiran Kumar Panigrahi
Kiran Kumar Panigrahi
Updated on 29-Aug-2023 33K+ Views

To get the longitude and latitude of a city, we will use the geopy module. geopy uses third-party geocoders and other data sources to locate the coordinates of addresses, cities, countries, etc.First of all, make sure the geopy module is installed −pip install geopyIn the following example, we will use the Nominatim geocoder to find the longitude and latitude of the city "Hyderabad".Steps −Import Nominatim geocoder from geopy module.Initialize the Nominatim API and use the geocode method to get the location of the input string.Finally, get the latitude and longitude of the location by location.latitude and location.longitude.Example 1# Import the ...

Read More

How to put a border around a Frame in Python Tkinter?

Kiran Kumar Panigrahi
Kiran Kumar Panigrahi
Updated on 28-Aug-2023 37K+ Views

To put a border around a Frame in Tkinter, we have to use the highlightbackground and highlightthickeness parameters while creating the Frame. Let's take an example and see how to use these two parameters.Steps −Import the tkinter library and create an instance of tkinter frame.Set the size of the frame using geometry() method.Create a frame with Frame() method. Highlight the border of the frame with a color, highlightbackground="blue". Then, set the thickness of the border, highlightthickness=2.Next, create some widgets inside the frame. In the example, we have placed four checkbuttons and a button inside the frame.Finally, run the mainloop of ...

Read More

How to place an image into a frame in Tkinter?

Kiran Kumar Panigrahi
Kiran Kumar Panigrahi
Updated on 22-Aug-2023 82K+ Views

To place an image into a Tkinter frame, you can follow the steps given below −Steps −Import the required libraries and create an instance of tkinter frame. To open an image and place it inside the frame, we will use the Pillow (PIL) library.Set the size of the frame using geometry method.Create a frame and specify its height and width. Place the frame at the center of the window using place() method with anchor='center'.Open an image using ImageTk.PhotoImage(Image.open("image"))Next, create a label object inside the frame and pass the image inside the label.Finally, run the mainloop of the application windowExample# Import ...

Read More

Create a GUI to extract information from VIN number Using Python

Tamoghna Das
Tamoghna Das
Updated on 25-Apr-2023 840 Views

A Vehicle Identification Number (VIN) is a unique 17-digit code assigned to every vehicle manufactured after 1981. It contains information about the vehicle’s make, model, year of manufacture, country of origin, and other relevant details. In this instruction manual, we will learn how to create a Graphical User Interface (GUI) using Python programming language to extract vehicle information from a VIN number. Prerequisites Before we dive into the details of creating a GUI, you should have a basic understanding of Python programming, object-oriented programming (OOP) concepts, and how to work with the Tkinter module. List of recommended settings pip ...

Read More

Create a GUI to Get Sunset and Sunrise Time using Python

Tamoghna Das
Tamoghna Das
Updated on 20-Apr-2023 721 Views

What is Python and what are its advantages? Python is a high-level programming language that is used for a wide range of applications, including web development, scientific computing, data analysis, and artificial intelligence. It has a simple and elegant syntax that makes it easy to read and write, and a large standard library that provides many useful tools and functions. Some of the advantages of Python include its readability, ease of use, flexibility, and portability. It is an open-source language, which means that it is freely available and can be modified and distributed by anyone. Python also has a large ...

Read More

Create a GUI to Get Domain Information using Tkinter

Tamoghna Das
Tamoghna Das
Updated on 20-Apr-2023 471 Views

In today's world, many businesses depend heavily on their online presence. Before setting up a website or purchasing a domain name, it is essential to get as much information as possible about the domain you plan to use. It may include information like domain owner, server location, IP address, WHOIS details, and much more. Therefore, in the following instruction manual, we'll guide you about creating a GUI to get domain information using Tkinter. What is GUI? GUI (Graphical User Interface) is a way to present data to the user in the form of interactive windows, buttons, and menus instead of ...

Read More

Create a GUI to Extract Lyrics from a song using Python

Tamoghna Das
Tamoghna Das
Updated on 20-Apr-2023 1K+ Views

Lyrics are the words that are sung in a song that conveys the meaning and emotions of a song. Python offers several libraries to extract lyrics from a song. In this tutorial, we will create a Graphical User Interface (GUI) using Python’s tkinter library that extracts lyrics from a song. What are the different formats in which songs are available online? There are several formats in which songs are available online, depending on the platform and the type of file. Some of the most common formats are − MP3 (MPEG Audio Layer 3) − This is the most common format ...

Read More
Showing 1–10 of 242 articles
« Prev 1 2 3 4 5 25 Next »
Advertisements