Python

How to Get the screen size (width and height) in Tkinter

In this tutorial, we will explore how to get the screen size—both width and height—using Tkinter, Python’s standard GUI toolkit. Understanding the screen dimensions is essential for creating responsive applications that adapt to different display sizes. We’ll walk through a simple example that demonstrates how to obtain these values programmatically, making it easier to design …

How to Get the screen size (width and height) in Tkinter Read More »

Get a list of all available fonts in Tkinter using Python

Get a list of all available fonts in Tkinter using Python: In this lesson, we will learn how to retrieve a list of all available fonts in Tkinter using Python. import tkinter as tk import tkinter.font as font root=tk.Tk() root.geometry(“300×400”) list_box=tk.Listbox(root,width=40,height=20) list_box.pack(side=tk.LEFT,fill=tk.BOTH,expand=True) scrollbar=tk.Scrollbar(root,orient=tk.VERTICAL) scrollbar.config(command=list_box.yview) scrollbar.pack(side=tk.RIGHT,fill=tk.Y) list_box.config(yscrollcommand=scrollbar.set) available_fonts=font.families() for i in available_fonts: list_box.insert(tk.END,i) root.mainloop() Output:   …

Get a list of all available fonts in Tkinter using Python Read More »

To Get The Official Website URL From A Company Name In Python

INTRODUCTION This Python code that takes a search term from the user, queries Google Search, and retrieves the first link from the results. It uses the requests library to make the HTTP request and BeautifulSoup to parse the HTML response. After extracting the first search result (since the first website is mostly the official URL) …

To Get The Official Website URL From A Company Name In Python Read More »

Company Name Matching From The dataset In Python

INTRODUCTION This program helps users quickly find company names by comparing an input with a dataset using fuzzy matching. It starts by normalizing the input, standardizing the format for accuracy, and then runs an algorithm to identify the closest matches based on similarity scores. After finding the best match, the program displays it, and users …

Company Name Matching From The dataset In Python Read More »

Python Program To Check The Given Date Is Valid Or Not

INTRODUCTION This Python program validates user-inputted dates using the datetime module. It checks whether a given date is valid based on standard calendar rules, including: Valid Month and Day Ranges: The program ensures that the month falls between 1 and 12 and that the day is appropriate for that month. Leap Year Conditions: It accurately …

Python Program To Check The Given Date Is Valid Or Not Read More »

Get Screen Width And Height Using Tkinter In Python

INTRODUCTION In this Python program we will learn how to get the screen width and height using Tkinter. This program uses the Tkinter library to create a GUI(Graphical User Interface) that shows the screen’s width and height. The window contains a title and two buttons which allow users to display the screen dimensions when the …

Get Screen Width And Height Using Tkinter In Python Read More »

Scroll to Top