Python Articles

Page 724 of 855

Plotting solar image in Python

Samual Sam
Samual Sam
Updated on 25-Mar-2026 441 Views

Python provides the SunPy package for working with solar physics data and creating solar images. This package includes various solar datasets from observatories and labs, containing proton/electron flux data and imaging data. You can install SunPy using the following command ? pip install sunpy What is AIA? The Atmospheric Imaging Assembly (AIA) is an instrument aboard the Solar Dynamics Observatory (SDO) that captures high-resolution images of the Sun's atmosphere in multiple wavelengths. The AIA provides crucial data for understanding solar activity and space weather. Creating a Solar Map SunPy uses the Map ...

Read More

Scraping and Finding Ordered Word in a Dictionary in Python

karthikeya Boyini
karthikeya Boyini
Updated on 25-Mar-2026 752 Views

Scraping web content and finding words with alphabetically ordered characters is a common text processing task in Python. This article shows how to fetch text data from a URL and identify words where characters are arranged in alphabetical order. Installing Required Module First, install the requests module for web scraping ? pip install requests Web Scraping Process The scraping involves these key steps ? Import the requests module Fetch data from a URL Decode the response using UTF-8 Convert the text into a list of words Finding Ordered Words ...

Read More

Underscore(_) in Python

Samual Sam
Samual Sam
Updated on 25-Mar-2026 752 Views

In Python, the underscore (_) character has several special uses and naming conventions. Understanding these patterns helps you write more Pythonic code and follow established conventions. Single Underscore in Interpreter The Python interpreter automatically stores the result of the last expression in the special variable _ ? # In interactive Python interpreter print(10 + 5) print(_) # Access last result print(_ * 2) # Use it in calculations 15 15 30 Ignoring Values in Unpacking Use _ as a throwaway variable when you don't need certain values during ...

Read More

Merge two sorted arrays in Python using heapq?

Samual Sam
Samual Sam
Updated on 25-Mar-2026 621 Views

The heapq module in Python provides an efficient way to merge multiple sorted iterables into a single sorted sequence. The heapq.merge() function is specifically designed for merging sorted arrays while maintaining the sorted order. The heapq.merge() Function The heapq.merge() function accepts multiple sorted iterables and returns an iterator that produces elements in sorted order. It uses a min-heap internally to efficiently merge the arrays without loading everything into memory at once. Syntax heapq.merge(*iterables, key=None, reverse=False) Basic Example Here's how to merge two sorted arrays using heapq.merge() ? import heapq ...

Read More

Creating child process using fork() in Python

karthikeya Boyini
karthikeya Boyini
Updated on 25-Mar-2026 2K+ Views

The fork() function in Python allows you to create child processes by duplicating the current process. This is a fundamental concept in Unix-like systems for process management and multithreading environments. When fork() is called, it creates an exact copy of the calling process. The return value helps distinguish between parent and child processes: 0 indicates the child process, a positive value indicates the parent process (containing the child's PID), and a negative value indicates an error occurred. Understanding fork() Return Values The fork() function returns different values depending on which process you're in ? Child ...

Read More

Play a video in reverse mode using Python OpenCv

karthikeya Boyini
karthikeya Boyini
Updated on 25-Mar-2026 806 Views

OpenCV (Open Source Computer Vision) is a powerful library for image and video processing in Python. One interesting application is playing videos in reverse mode by manipulating the frame order. Application Areas of OpenCV Facial recognition system Motion tracking Artificial neural network Deep neural network Video streaming Installation For Windows ? pip install opencv-python For Linux ? sudo apt-get install python-opencv Steps to Play Video in Reverse Import OpenCV library (cv2) Load the video file as input Extract all frames from the video and ...

Read More

Read and Write to an excel file using Python openpyxl module

karthikeya Boyini
karthikeya Boyini
Updated on 25-Mar-2026 6K+ Views

Python provides the openpyxl module for reading and writing Excel files. This powerful library allows you to create, modify, and extract data from Excel workbooks programmatically. Installation Install openpyxl using pip ? pip install openpyxl Getting Sheet Title When you create a new workbook, it comes with a default sheet ? import openpyxl my_wb = openpyxl.Workbook() my_sheet = my_wb.active my_sheet_title = my_sheet.title print("My sheet title: " + my_sheet_title) My sheet title: Sheet Changing Sheet Title You can customize the sheet name by modifying the ...

Read More

Decimal Functions in Python

karthikeya Boyini
karthikeya Boyini
Updated on 25-Mar-2026 13K+ Views

The Decimal module in Python provides precise decimal floating-point arithmetic, avoiding the common rounding errors that occur with standard floating-point numbers. This module is particularly useful for financial calculations where precision is critical. To use the Decimal module, you need to import it first ? import decimal Square Root and Exponential Functions The sqrt() method calculates the square root of a decimal number, while exp() returns ex for a given decimal value ? import decimal my_dec = decimal.Decimal(25.36) print(my_dec) print('Square Root is:', my_dec.sqrt()) print('e^x is:', my_dec.exp()) 25.3599999999999994315658113919198513031005859375 Square ...

Read More

Create a Website Alarm Using Python

Samual Sam
Samual Sam
Updated on 25-Mar-2026 587 Views

In this section we will see how to create a website alarm system using Python. This tool automatically opens a specified website URL in your browser at a predetermined time. Problem Statement Create a program that opens a website URL on the browser by taking a website URL and time as input. When the system time reaches the specified time, the webpage will be opened automatically. We can store different web pages in our bookmark sections. Sometimes we need to open some web pages every day at a specific time to do some work. For that purpose, ...

Read More

Python Program to calculate the Round Trip Time (RTT)

karthikeya Boyini
karthikeya Boyini
Updated on 25-Mar-2026 2K+ Views

Here we will see how Python can be used to get the Round Trip Time (RTT). The RTT is the time taken by the entire trip of a signal — the time between when a signal is sent and when the acknowledge signal is received. The RTT results vary based on different parameters like ? The data transfer rate of the sender's side. The nature of the transmission media. The actual distance between the sender and receiver. The number of nodes between sender and receiver. ...

Read More
Showing 7231–7240 of 8,546 articles
« Prev 1 722 723 724 725 726 855 Next »
Advertisements