Server Side Programming Articles

Page 602 of 2109

Difference between various Implementations of Python?

AmitDiwan
AmitDiwan
Updated on 25-Mar-2026 456 Views

Python is a language specification that can be implemented in different ways. Most developers use Python without knowing which specific implementation runs on their system. When we say "Python, " we could mean CPython (the standard implementation), Jython, IronPython, PyPy, or other variants. Each implementation serves different purposes and has unique characteristics. Understanding these differences helps you choose the right Python implementation for your specific use case. CPython CPython is the reference implementation of Python written in C. It's the most widely used Python implementation and what most people simply call "Python." Key Features ...

Read More

Working with PDF files in Python?

Vrundesha Joshi
Vrundesha Joshi
Updated on 25-Mar-2026 1K+ Views

Python provides excellent libraries for working with PDF files. PyPDF2 is a popular pure-Python library that can split, merge, crop, and transform PDF pages. It can also extract text, metadata, and add security features to PDF files. Installation Install PyPDF2 using pip ? pip install PyPDF2 Verify the installation ? import PyPDF2 print("PyPDF2 imported successfully!") PyPDF2 imported successfully! Extracting PDF Metadata You can extract useful information like author, title, subject, and page count from any PDF file ? from PyPDF2 import PdfFileReader def ...

Read More

Junk File Organizer in Python?

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

Organizing files by type can save time when dealing with cluttered directories. This Python script automatically sorts files into appropriate folders based on their extensions and removes empty directories. File Type Configuration First, we define which file extensions belong to each category ? import os from pathlib import Path DIRECTORIES = { "HTML": [".html5", ".html", ".htm", ".xhtml"], "IMAGES": [".jpeg", ".jpg", ".tiff", ".gif", ".bmp", ".png", ".bpg", ".svg", ".heif", ".psd"], ...

Read More

Determine the type of an image in Python?

Nitya Raut
Nitya Raut
Updated on 25-Mar-2026 4K+ Views

In this section, we are going to see how to determine the type of image file programmatically using Python. Consider a situation where you have hundreds of image files in a directory and want to filter specific image formats like JPEG, PNG, or GIF. Python provides the imghdr library to determine the type of an image contained in a file or byte stream. Installation The imghdr module is a standard library package that comes with Python 3.6 and higher installations. However, if you need to install it separately, run the following command ? pip install ...

Read More

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 339 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 912 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 585 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
Showing 6011–6020 of 21,090 articles
« Prev 1 600 601 602 603 604 2109 Next »
Advertisements