Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by Pradeep Elance
Page 21 of 32
Collapsible Pane in Tkinter Python
Tkinter is the GUI building library of Python. In this article, we will see how to create a collapsible pane using Tkinter. Collapsible panes are useful when you have a large amount of data to display on a GUI canvas but don't want it to be visible all the time. They can be expanded or collapsed as needed to save screen space. A collapsible pane typically consists of a toggle button and a frame that can be shown or hidden. When collapsed, only the toggle button is visible. When expanded, the frame containing additional widgets becomes visible. Creating ...
Read MoreBinning method for data smoothing in Python
Data smoothing is a crucial preprocessing technique in statistical analysis that helps reduce noise and makes data more suitable for analysis. The binning method is one approach where we group data values into discrete intervals called bins, making continuous data easier to handle and analyze. Understanding Binning Binning involves creating ranges (bins) and assigning data values to these ranges. The upper boundary of each bin is excluded and belongs to the next bin. This helps in data discretization and noise reduction. Manual Binning Example Let's understand binning with a simple example ? # Given ...
Read MoreASCII art using Python pyfiglet module
The pyfiglet module in Python allows you to create stylish ASCII art text with various fonts. This module transforms regular text into large, decorative ASCII representations that are perfect for banners, headers, or creative displays. Installation First, install the pyfiglet module using pip ? pip install pyfiglet Default Font Example The simplest way to create ASCII art is using the default font ? import pyfiglet # Text in default font result = pyfiglet.figlet_format("Python") print(result) ____ _ _ ...
Read MoreAdd one Python string to another
String concatenation in Python combines two or more strings into a single string. Python provides several methods to add strings together, with the + operator and join() method being the most common approaches. Using the + Operator The + operator concatenates strings by combining them sequentially. This is the most straightforward method for joining strings ? first_string = "What a beautiful " second_string = "flower" print("Given string s1:", first_string) print("Given string s2:", second_string) # Using + operator result = first_string + second_string print("Result after adding strings:", result) Given string s1: What ...
Read MoreAdd list elements with a multi-list based on index in Python
When working with nested lists, you may need to add elements from a simple list to elements within a nested list based on their index positions. This operation pairs each element from the simple list with the corresponding sublist in the nested list and adds the simple list element to each item in that sublist. If the lists have different lengths, the operation is limited by the shorter list. Below are three efficient methods to accomplish this task. Using for Loop This method uses nested loops to iterate through both lists simultaneously. We take the length of ...
Read MoreHow to Watch TCP and UDP Ports in Real-time in Linux?
In computer networks, services running on Linux systems communicate using protocols like TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) along with specific port numbers. Monitoring these ports in real-time helps system administrators track network activity, troubleshoot connectivity issues, and ensure security. List of Open Ports To view all currently open ports that are listening for connections, use the netstat command with specific flags ? $ sudo netstat -tulpn The flags have the following meanings ? t − Enable listing of TCP ports u − Enable listing of UDP ports l ...
Read MoreHow to View Colored Man Pages in Linux?
Man pages are important reference documents for Unix/Linux users, but their default appearance is plain text that can be hard to read. This article shows how to add colors and highlighting to man pages to make them more readable and easier to follow. Using most The most command is a pager that can display colored man pages. First, install it using your package manager ? sudo apt install most Once installed, add most as your default pager by adding this line to your .bashrc file ? export PAGER="most" Reload your ...
Read MoreHow to Run a Command with Time Limit (Timeout) In Linux
Sometimes a Unix command may run for a very long time without giving the final output or it may keep processing giving partial output from time to time. In such scenarios we need to put a time frame within which either the command must complete or the process should abort. This is achieved by using timeout tools. Using timeout Tool The timeout tool forces a command to abort if it cannot complete within a given time frame. This is a built-in utility available on most Linux systems. Syntax timeout DURATION COMMAND [ARG]... Where ...
Read MoreHow to Find a Specific String or Word in Files and Directories in Linux
Finding specific strings or words across multiple files in Linux is a common task for developers and system administrators. This article explores several Linux commands to efficiently search for text patterns across files and directories. Using grep The grep command is a powerful regular expression search tool that matches text patterns in files. At its basic level, it searches for a string within specified files ? grep 'string' directory-path/*.* Example grep 'config' hadoop-2.6.5/etc/hadoop/*.* The output shows all files containing the word "config" ? hadoop-2.6.5/etc/hadoop/capacity-scheduler.xml: hadoop-2.6.5/etc/hadoop/core-site.xml: hadoop-2.6.5/etc/hadoop/hadoop-policy.xml: hadoop-2.6.5/etc/hadoop/hdfs-site.xml: ...
Read MoreHow to decorate your Linux Terminal using Shell?
The Linux terminal appearance can be customized using shell commands and environment variables. While GUI settings provide basic customization, shell commands offer more precise control over colors, fonts, and prompt formatting in Ubuntu-based systems. Most terminal customizations are handled through environment variables that can be modified using shell commands. The primary variable for controlling the terminal prompt is PS1. The PS1 Variable The PS1 variable controls the primary prompt string displayed when the shell is ready to read a command. It uses backslash-escaped special characters to determine what appears at the prompt ? echo $PS1 ...
Read More