Articles on Trending Technologies

Technical articles with clear explanations and examples

Command Line Interface Programming in Python?

Jennifer Nicholas
Jennifer Nicholas
Updated on 25-Mar-2026 1K+ Views

Command Line Interface (CLI) programming allows you to create interactive programs that run from the terminal. Python provides several approaches to build CLIs, from basic sys.argv parsing to advanced libraries like click. Understanding Command Line Components A command line program consists of three main components: Arguments: Required parameters passed to the script. For example, numpy is the argument in: pip install numpy Options: Optional name-value pairs like: pip install django --cache-dir ./my-cache-dir where --cache-dir is an option with value ./my-cache-dir Flags: Optional boolean parameters that enable/disable behavior, such as --help Method 1: Using sys.argv ...

Read More

Python Rational numbers (fractions)

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

Any number which can be expressed as a quotient or fraction in the form of p/q is called a rational number. The fractions module of Python's standard library provides functionality for rational number arithmetic with exact precision, avoiding floating-point rounding errors. Creating Fraction Objects The fractions module defines a Fraction class that can be constructed in various ways ? Using Numerator and Denominator from fractions import Fraction n1 = Fraction(2, 5) print(n1) n2 = Fraction(6, 15) # Automatically reduced to lowest terms print(n2) n3 = Fraction(10, 1) print(n3) n4 = ...

Read More

Calculate geographic coordinates of places using google geocoding API in Python?

Vrundesha Joshi
Vrundesha Joshi
Updated on 25-Mar-2026 332 Views

To get the geographic coordinates (longitude and latitude) of any place, we can use the Google Maps Geocoding API. This API converts addresses into geographic coordinates and provides detailed location information. Requirements To get the coordinates of a place, you need a Google Geocoding API key. You can get it from the official Google documentation: https://developers.google.com/maps/documentation/geocoding/get-api-key Apart from the API key, we need the following Python modules − requests module (to fetch the coordinates from API) json module (for JSON data conversion) Basic Implementation Here's ...

Read More

Calculate distance and duration between two places using google distance matrix API in Python?

Nitya Raut
Nitya Raut
Updated on 25-Mar-2026 900 Views

We almost all use Google Maps to check distance between source and destination and check the travel time. For developers and enthusiasts, Google provides the Google Distance Matrix API to calculate the distance and duration between two places programmatically. To use Google Distance Matrix API, we need Google Maps API keys, which you can get from the official documentation: https://developers.google.com/maps/documentation/distance-matrix/get-api-key Required Libraries We can accomplish this by using different Python libraries: requests − For making HTTP API calls json − For parsing JSON responses googlemaps − Official Google Maps client (optional) pandas − For ...

Read More

Python script to open a Google Map location on clipboard?

Jennifer Nicholas
Jennifer Nicholas
Updated on 25-Mar-2026 1K+ Views

Automating the process of opening Google Maps locations can save time when you frequently search for places. This Python script reads a location from either command line arguments or the clipboard and automatically opens it in Google Maps using your default browser. Required Installation We need to install the pyperclip package to access clipboard content ? pip install pyperclip How the Script Works The script follows these steps ? Check if a location is provided as command line arguments If no arguments, read ...

Read More

Plotting Data on Google Map using pygmaps package?

Jennifer Nicholas
Jennifer Nicholas
Updated on 25-Mar-2026 582 Views

Python's pygmaps library provides a wrapper for the Google Maps JavaScript API, allowing you to create interactive maps with custom data visualization. This library offers a matplotlib-like interface to generate HTML and JavaScript for displaying information on Google Maps. Installation Install the pygmaps library using pip ? # Windows pip install pygmaps # Linux/Mac sudo pip3 install pygmaps Key Features The pygmaps library allows you to ? Create interactive maps with custom latitude, longitude, and zoom levels Add grid overlays to display coordinate systems Place colored markers at specific locations ...

Read More

Phyllotaxis pattern in Python?

Nitya Raut
Nitya Raut
Updated on 25-Mar-2026 483 Views

Phyllotaxis is the arrangement of leaves, flowers, or seeds on a plant stem following mathematical patterns found in nature. This pattern creates beautiful spirals similar to those seen in sunflowers, pine cones, and nautilus shells, based on the golden angle of approximately 137.5 degrees. Understanding Phyllotaxis The phyllotaxis pattern is closely related to the Fibonacci sequence (1, 1, 2, 3, 5, 8, 13, 21...), where each number is the sum of the two preceding ones. In nature, plants use this mathematical principle to maximize sunlight exposure and optimize space utilization. Fibonacci Sequence in Nature ...

Read More

WebCam Motion Detector program in Python ?

Vrundesha Joshi
Vrundesha Joshi
Updated on 25-Mar-2026 488 Views

A WebCam Motion Detector analyzes images from your webcam to detect movement and logs the time intervals when motion occurs. This program uses computer vision techniques to compare frames and identify changes. Required Libraries Install the required libraries using pip ? pip install opencv-python pandas How Motion Detection Works Background Frame Compare Current Frame ...

Read More

Fetch top 10 starred repositories of user on GitHub using Python?

Jennifer Nicholas
Jennifer Nicholas
Updated on 25-Mar-2026 187 Views

GitHub is the world's largest platform for version control and collaborative development. You can scrape GitHub's trending repositories page to fetch the top 10 most starred repositories within a specific timeframe using Python's requests and BeautifulSoup libraries. This tutorial demonstrates how to scrape GitHub's trending page, extract repository information, and save the results to a file with proper formatting. Required Libraries First, ensure you have the necessary libraries installed ? pip install requests beautifulsoup4 lxml Complete Implementation Here's the complete code to fetch and display the top 10 trending repositories ? ...

Read More

Conway's Game Of Life using Python?

Vrundesha Joshi
Vrundesha Joshi
Updated on 25-Mar-2026 755 Views

Conway's Game of Life is a cellular automaton created by British mathematician John Conway in 1970. It simulates the evolution of a colony of biological organisms on a two-dimensional grid consisting of "living" and "dead" cells. Rules of Conway's Game of Life The game follows four simple rules that determine whether a cell lives or dies in the next generation ? Overpopulation: A living cell dies if it has more than three living neighbors Survival: A living cell survives if it has two or three living neighbors Underpopulation: A living ...

Read More
Showing 7091–7100 of 61,303 articles
« Prev 1 708 709 710 711 712 6131 Next »
Advertisements