Server Side Programming Articles

Page 136 of 2109

Connect new point to the previous point on a image with a straight line in OpenCV-Python

Harshit Sachan
Harshit Sachan
Updated on 27-Mar-2026 1K+ Views

In OpenCV-Python, we can draw lines between points on an image to create paths, track movements, or create interactive drawing applications. This is particularly useful for computer vision applications where user interaction is required. OpenCV (Open Source Computer Vision Library) provides powerful functions for image manipulation and computer vision tasks. In this article, we will learn how to connect mouse-clicked points on an image with straight lines using OpenCV-Python. Understanding the cv2.line() Function To draw a straight line between two points, OpenCV provides the cv2.line() function with the following syntax: cv2.line(image, start_point, end_point, color, thickness) ...

Read More

Convert BGR and RGB with Python and OpenCV

Harshit Sachan
Harshit Sachan
Updated on 27-Mar-2026 13K+ Views

OpenCV is a library of programming functions primarily for real-time computer vision. The library is cross-platform and licensed as free and open source software under the Apache License. It is written in C++ and has Python bindings that make it easy to use in Python applications. In this article, we will learn how to convert between BGR and RGB color formats using Python and OpenCV. Before proceeding, let's understand what BGR and RGB are and why conversion is necessary. What are BGR and RGB? RGB and BGR are both color models used to represent colors in digital ...

Read More

How to Package a Command Line Python Script

Harshit Sachan
Harshit Sachan
Updated on 27-Mar-2026 3K+ Views

Python is a powerful programming language widely used for creating various applications, including command-line interface (CLI) scripts that automate tasks. To share these scripts with others, you need to package and distribute them properly. This article will guide you through the complete process of packaging a Python command-line script, making it easy to distribute and install. Step 1: Create a Virtual Environment First, create an isolated environment for your project to manage dependencies effectively ? python -m venv myproject_env Activate the virtual environment ? # On Windows myproject_env\Scripts\activate # On ...

Read More

Command Line Scripts - Python Packaging

Harshit Sachan
Harshit Sachan
Updated on 27-Mar-2026 452 Views

Python command line interface (CLI) scripts are programs that perform specific tasks when executed from the command line. These scripts help automate repetitive tasks and can be packaged for easy distribution to other developers. This article covers the complete process of creating, packaging, and distributing Python CLI scripts. Creating the CLI Script First, let's create a simple CLI script that accepts command line arguments using the argparse library ? import argparse def greet(name): print(f"Hello, {name}!") def main(): parser = argparse.ArgumentParser(description="A simple greeting CLI tool") ...

Read More

Create a GUI to Get Sunset and Sunrise Time using Python

Tamoghna Das
Tamoghna Das
Updated on 27-Mar-2026 757 Views

In this tutorial, we'll create a GUI application using Python's Tkinter library to display sunrise and sunset times for any location. We'll use the astral library to calculate astronomical data based on geographic coordinates. Prerequisites Before starting, ensure you have: Python 3.x installed − Tkinter comes bundled with Python Astral library − Install using: pip install astral Basic Python knowledge − Functions, classes, and GUI concepts Installing Required Libraries The astral library provides astronomical calculations for sunrise, sunset, and twilight times − pip install astral Importing Required Modules ...

Read More

Create a GUI to Extract Lyrics from a song using Python

Tamoghna Das
Tamoghna Das
Updated on 27-Mar-2026 1K+ Views

Lyrics are the words that are sung in a song that conveys the meaning and emotions of a song. Python offers several libraries to extract lyrics from a song. In this tutorial, we will create a Graphical User Interface (GUI) using Python's tkinter library that extracts lyrics from a song. Prerequisites Before we dive into the details of creating a GUI, you should have a basic understanding of Python programming, object-oriented programming (OOP) concepts, and how to work with the Tkinter module. Required installations and setup − Install required libraries: pip install lyricsgenius (tkinter comes ...

Read More

Create a GUI to convert CSV file to Excel file using Python

Tamoghna Das
Tamoghna Das
Updated on 27-Mar-2026 1K+ Views

As businesses grow and expand, they need to manage a lot of information. This information may come in different formats, and being able to convert them to the right format is important for the smooth running of business operations. One of the ways to handle this is by converting CSV files to Excel format. In this tutorial, we will build a Graphical User Interface (GUI) in Python to convert CSV files to Excel files. What is a CSV File? A CSV (Comma Separated Values) file is a plain text file that stores tabular data in a structured format. ...

Read More

Create a GUI for weather forecast using weatherstack API in python

Tamoghna Das
Tamoghna Das
Updated on 27-Mar-2026 1K+ Views

Weather forecasting is essential for daily planning and decision-making. The weatherstack API provides accurate weather data that can be integrated into Python applications. In this tutorial, we will create a graphical user interface (GUI) using tkinter to display real-time weather information. Prerequisites Before starting, ensure you have the following ? Python 3.6 or higher installed tkinter (usually comes with Python installation) requests library: pip install requests A free weatherstack API key from weatherstack.com Setting Up the Weather GUI Application Step 1: Import Required Libraries import tkinter as tk from tkinter import ...

Read More

How to Create a Hotkey in Python?

Mukul Latiyan
Mukul Latiyan
Updated on 27-Mar-2026 8K+ Views

Hotkeys are a convenient way to automate repetitive tasks in Python programs. They allow users to perform actions quickly and easily, without having to navigate through menus or use a mouse. In this tutorial, we will discuss how to create a hotkey in Python using the keyboard library. The keyboard library provides a simple and easy-to-use API for registering hotkeys and responding to keyboard events. By creating hotkeys in your Python programs, you can enhance the user experience and improve productivity by allowing users to perform tasks quickly and efficiently. Installation Before we start, install the keyboard ...

Read More

How to Count the Number of Rows in a MySQL Table in Python?

Mukul Latiyan
Mukul Latiyan
Updated on 27-Mar-2026 10K+ Views

Counting the number of rows in a MySQL table is a common operation when working with databases. In Python, you can use MySQL connector libraries to establish a connection and execute SQL queries. This article demonstrates two effective approaches: using the cursor's execute() method and the SQL COUNT(*) function. Database Setup For our examples, we'll use a database named insillion with a table called bikes containing the following data: mysql> SELECT * FROM bikes; +----+-------+-------+ | id | name | price | +----+-------+-------+ | 1 | Bajaj | 2543 | | 2 ...

Read More
Showing 1351–1360 of 21,090 articles
« Prev 1 134 135 136 137 138 2109 Next »
Advertisements