Server Side Programming Articles

Page 598 of 2109

NZEC error in Python?

Arjun Thakur
Arjun Thakur
Updated on 25-Mar-2026 975 Views

NZEC (Non-Zero Exit Code) is a runtime error that occurs when a Python program terminates abnormally. Exit codes are numbers returned by programs to the operating system - 0 indicates successful termination, while non-zero codes indicate errors. What Causes NZEC Error? NZEC errors commonly occur due to: Incorrect input handling − Not properly parsing input format Array index errors − Accessing negative or out-of-bounds indices Memory overflow − Using more memory than allocated Infinite recursion − Running out of stack memory Division by zero − Basic arithmetic errors Integer overflow − Values exceeding variable limits ...

Read More

Line detection in python with OpenCV?

Ankith Reddy
Ankith Reddy
Updated on 25-Mar-2026 4K+ Views

In this article, we will learn how to detect lines in an image using the Hough Transform technique with OpenCV in Python. What is Hough Transform? Hough Transform is a feature extraction method used to detect simple geometric shapes in images. It can identify shapes even if they are broken or slightly distorted, making it particularly useful for line detection in computer vision applications. A "simple" shape is one that can be represented by only a few parameters. For example: A line requires two parameters: slope and intercept A circle requires three parameters: center coordinates ...

Read More

Packaging and Publishing Python code?

George John
George John
Updated on 25-Mar-2026 355 Views

Python provides a straightforward way to create, package, and publish your code for others to use. This process involves creating a proper package structure, configuring metadata, and uploading to the Python Package Index (PyPI). Package Management Tools Python offers several tools for package management: pip − The standard package installer that manages installations and updates. It handles dependencies and version numbers automatically. Python Package Index (PyPI) − The official repository where packages are published and can be installed using pip install package_name. setuptools − Provides packaging functionality and distribution utilities. wheel − Creates built distributions that ...

Read More

Mouse and keyboard automation using Python?

Chandu yadav
Chandu yadav
Updated on 25-Mar-2026 2K+ Views

Python automation of mouse and keyboard controls allows you to create scripts that can perform repetitive tasks, control applications, and simulate user interactions. The PyAutoGUI module provides a simple way to automate GUI interactions programmatically. Installing PyAutoGUI PyAutoGUI is a cross-platform GUI automation library that needs to be installed separately ? pip install pyautogui Mouse Automation PyAutoGUI provides several functions to control mouse movement and clicking. Let's explore the basic mouse operations ? Getting Screen Information import pyautogui # Get screen dimensions screen_size = pyautogui.size() print(f"Screen size: {screen_size}") ...

Read More

Using OpenCV in Python to Cartoonize an Image

Arjun Thakur
Arjun Thakur
Updated on 25-Mar-2026 1K+ Views

Image cartoonization is a popular computer vision technique that transforms regular photos into cartoon-style images. While many professional cartoonizer applications exist, most are paid software. Using OpenCV in Python, we can achieve this effect by combining bilateral filtering for color reduction and edge detection for bold outlines. Algorithm Overview The cartoonization process involves five key steps: Apply bilateral filter to reduce the color palette of the image Convert the original image to grayscale Apply median blur to reduce image noise in the grayscale image ...

Read More

OpenCV Python Program to blur an image?

Ankith Reddy
Ankith Reddy
Updated on 25-Mar-2026 708 Views

OpenCV is one of the best Python packages for image processing. Like signals carry noise attached to them, images too contain different types of noise mainly from the source itself (camera sensor). Python's OpenCV package provides ways for image smoothing, also called blurring. One of the most common techniques is using a Gaussian filter for image blurring, which smooths sharp edges while minimizing excessive blur. Syntax cv2.GaussianBlur(src, ksize, sigmaX[, dst[, sigmaY[, borderType]]]) Parameters src − Input image ksize − Gaussian kernel size as (width, height). Both values must be odd and positive sigmaX ...

Read More

Permutation and Combination in Python?

Chandu yadav
Chandu yadav
Updated on 25-Mar-2026 1K+ Views

In this section, we are going to learn how to find permutation and combination of a given sequence using Python programming language. Python's itertools module provides built-in functions to generate permutations and combinations efficiently. A permutation is an arrangement of items where order matters, while a combination is a selection where order doesn't matter. Understanding Permutations vs Combinations Before diving into code, let's understand the difference: Permutation: Order matters. For items [A, B], permutations are (A, B) and (B, A) Combination: Order doesn't matter. For items [A, B], there's only one combination: (A, B) ...

Read More

Python program to Rearrange a string so that all same characters become d distance away

Arjun Thakur
Arjun Thakur
Updated on 25-Mar-2026 1K+ Views

Given a string and an integer d, we need to rearrange the string such that all same characters are at least distance d apart from each other. If it's not possible to rearrange the string, we return an empty string. Problem Understanding The key challenge is to place characters with higher frequencies first, ensuring they have enough positions to maintain the required distance d. Example 1 str_input = "tutorialspoint" d = 3 # Result: "tiotiotalnprsu" # Same characters are at least 3 positions apart Example 2 str_input = "aaabc" d = ...

Read More

Python program to Find the first non-repeating character from a stream of characters?

AmitDiwan
AmitDiwan
Updated on 25-Mar-2026 9K+ Views

In this article, we will find the first non-repeating character from a stream of characters. A non-repeating character is one that appears exactly once in the string. Let's say the following is our input ? thisisit The following should be our output displaying first non-repeating character ? h Using While Loop We will find the first non-repeating character by comparing each character with others using a while loop. This approach removes all occurrences of each character and checks if only one was removed ? # String my_str = "thisisit" ...

Read More

Python program to Count words in a given string?

Chandu yadav
Chandu yadav
Updated on 25-Mar-2026 4K+ Views

Sometimes we need to count the number of words in a given string. Python provides several approaches to accomplish this task, from manual counting using loops to built-in methods like split(). Using For Loop This method counts words by detecting whitespace characters manually − test_string = "Python is a high level language. Python is interpreted language." total = 1 for i in range(len(test_string)): if test_string[i] == ' ' or test_string[i] == '' or test_string[i] == '\t': total = total + 1 print("Total ...

Read More
Showing 5971–5980 of 21,090 articles
« Prev 1 596 597 598 599 600 2109 Next »
Advertisements