Articles on Trending Technologies

Technical articles with clear explanations and examples

Python to create a digital clock using Tkinter

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 3K+ Views

Python Tkinter can be used to create all kinds of GUI programs for desktop applications. In this article, we will see how to create a digital clock that displays the current time in hours, minutes, and seconds format with live updates. We use the time module to import the strftime() method, which formats the current time. The clock updates automatically every 200 milliseconds using a recursive function and Tkinter's after() method. Creating the Digital Clock Here's how to build a simple digital clock using Tkinter ? import time from tkinter import * # Create ...

Read More

How to Make a Child Div Element Wider than Parent Div using CSS?

Pankaj Kumar Bind
Pankaj Kumar Bind
Updated on 15-Mar-2026 2K+ Views

In CSS, there are times when you want to stretch a child div element beyond its parent div, often for specific design requirements. While this goes against the normal flow where children are contained within their parents, CSS provides several properties to achieve this effect. Syntax /* Method 1: Using overflow property */ .parent { overflow: visible; } .child { width: value-larger-than-parent; } /* Method 2: Using positioning */ .parent { position: relative; } .child { position: absolute; ...

Read More

Add style to Python tkinter button

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 4K+ Views

Tkinter has great support for creating GUI programs based on Python. It offers different ways of styling buttons on the Tkinter canvas based on font, size, color, and other properties. In this article, we will see how to apply styles to specific buttons or all buttons in general on the canvas using the ttk.Style class. Applying Style to Specific Buttons Let's consider the case when we have two buttons in the canvas and we want to apply styling only to the first button. We use a custom style name like 'W.TButton' as part of the configuration along with ...

Read More

How to Style the Selected Label of a Radio Button?

Pankaj Kumar Bind
Pankaj Kumar Bind
Updated on 15-Mar-2026 1K+ Views

In this article, we will style the label for the radio button which is currently selected. CSS allows you to eliminate the default radio button and style the selected and unselected states of the labels. This is accomplished with the help of the :checked pseudo-class and adjacent sibling selectors. Syntax input[type="radio"]:checked + label { /* Styles for selected label */ } label { /* Default label styles */ } Styling the Selected Label of a Radio Button To begin with, we hide the original circular ...

Read More

Python - Filtering data with Pandas .query() method

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 3K+ Views

The Pandas .query() method provides a powerful way to filter DataFrame rows using a string-based query expression. It offers a more readable alternative to boolean indexing for complex filtering conditions. Basic Syntax The .query() method accepts a query string and optional parameters ? import pandas as pd # Create sample dataset data = { 'age': [25, 30, 35, 40, 45, 50, 55, 60, 65], 'salary': [30000, 45000, 55000, 65000, 70000, 80000, 85000, 90000, 95000], 'department': ['IT', 'HR', 'IT', 'Finance', 'HR', 'IT', 'Finance', 'HR', ...

Read More

How to insert Spaces/Tabs in text using HTML and CSS?

Akif Jaseem
Akif Jaseem
Updated on 15-Mar-2026 452 Views

To insert spaces/tabs in text using HTML and CSS, can be tricky as HTML generally doesn't recognize multiple spaces or tabs by default. If you add extra spaces in your code, they'll collapse into a single space when displayed in the browser. We will be understanding three different approaches to insert spaces in text. Syntax /* Using CSS properties for spacing */ selector { margin-left: value; padding-left: value; text-indent: value; } Approaches to Insert Spaces/Tabs in Text ...

Read More

Python - Filter out integers from float numpy array

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 564 Views

When working with NumPy arrays containing both floats and integers, you may need to filter out integer values for data cleansing purposes. This article demonstrates two effective methods to remove integers from a float NumPy array using astype comparison and modulo operations. Method 1: Using astype Comparison The astype function converts array elements to integers. By comparing the original array with its integer-converted version, we can identify which elements are not integers ? Example import numpy as np # Create array with mixed floats and integers data_array = np.array([3.2, 5.5, 2.0, 4.1, 5]) ...

Read More

Python - Filter dictionary key based on the values in selective list

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 2K+ Views

Sometimes in a Python dictionary we may need to filter out certain keys based on a selective list. This allows us to extract specific key-value pairs from a larger dictionary. In this article we will see how to filter dictionary keys using different approaches. Using List Comprehension with 'in' Operator In this approach we put the keys to be filtered in a list. Then iterate through each element of the list and check for its presence in the given dictionary. We create a resulting dictionary containing only these filtered key-value pairs ? Example # Original ...

Read More

How to Set a Box-Shadow Only on the Left and Right Sides?

REDUAN AHMAD
REDUAN AHMAD
Updated on 15-Mar-2026 421 Views

In this article, we'll learn how to create a box-shadow that appears only on the left and right sides of an element using CSS. Box shadows are popular for adding depth and dimension to web elements, but by default, shadows apply to all four sides. Here, we'll explore a simple method to achieve shadows only on the sides. Syntax selector { box-shadow: horizontal-offset vertical-offset blur-radius spread-radius color, horizontal-offset vertical-offset blur-radius spread-radius color; } Understanding Box-Shadow ...

Read More

Python - end parameter in print()

Pradeep Elance
Pradeep Elance
Updated on 15-Mar-2026 1K+ Views

The print() function in Python automatically adds a newline character () at the end of each print statement. However, you can customize this behavior using the end parameter to specify different ending characters or strings. Syntax print(value1, value2, ..., end='character_or_string') Default Behavior By default, print() ends with a newline character ? print("Welcome to") print("Tutorialspoint") Welcome to Tutorialspoint Using Space as End Character You can replace the newline with a space to print on the same line ? print("Welcome to", end=' ') print("Tutorialspoint") ...

Read More
Showing 19381–19390 of 61,297 articles
Advertisements