Server Side Programming Articles

Page 98 of 2109

How to search the max value of an attribute in an array object ?

Rohan Singh
Rohan Singh
Updated on 27-Mar-2026 2K+ Views

When working with objects in Python, we often need to find the maximum value of an attribute in a list of objects. Python provides several approaches including simple loops, the max() function with a key parameter, and list comprehensions. In this article, we will explore these methods with practical examples. Method 1: Using For Loops In this method, we iterate through the list of objects using a loop and compare the attribute value of each object with the current maximum value. Syntax for obj in objects: if obj.attribute > max_value: ...

Read More

How to search for a string in text files using Python?

Rohan Singh
Rohan Singh
Updated on 27-Mar-2026 9K+ Views

Searching for a string in text files is an important task while doing data analysis on text data. In Python, we can search for a string in text files using various methods like reading and searching line by line, reading the entire file, and using regular expressions, or using the grep command. Method 1: Reading and Searching Line by Line One straightforward approach is to read the text file line by line and search for the desired string in each line. This method is memory-efficient and suitable for large text files. Syntax for line in ...

Read More

How to Search a Pickle File in Python

Rohan Singh
Rohan Singh
Updated on 27-Mar-2026 947 Views

Pickle is a Python module that is used for serializing and deserializing Python objects. It allows you to save and load complex data structures, such as lists, dictionaries, and even custom objects, in a binary format. When working with pickle files, you might encounter scenarios where you need to search for specific information within a pickle file. In this article, we'll explore various methods to search a pickle file in Python. Understanding Pickle Files A pickle file is a binary file that contains serialized Python objects. The pickle module in Python provides functions to convert objects into a ...

Read More

How to Scroll Down Followers Popup on Instagram using Python

Rohan Singh
Rohan Singh
Updated on 27-Mar-2026 1K+ Views

Instagram is a popular social media platform that allows users to connect and share content with their followers. As a developer, you might need to automate certain tasks on Instagram, such as extracting follower data. Instagram's follower popup only loads a limited number of followers at a time, requiring users to scroll down to view more followers. In this article, we will explore how to scroll down the followers popup on Instagram using Python and Selenium WebDriver. Prerequisites Before starting, you need to install the required dependencies: pip install selenium You also need to ...

Read More

How to save pyttsx3 results to MP3 or WAV file?

Rohan Singh
Rohan Singh
Updated on 27-Mar-2026 3K+ Views

The pyttsx3 is a Python library that provides a simple interface for text-to-speech (TTS) synthesis. Text to Speech converts written text to spoken words and allows customization of various speech parameters. This article demonstrates how to save pyttsx3 results to MP3 or WAV files using different methods. Basic Process Overview The general steps for saving pyttsx3 output to audio files are: Initialize the pyttsx3 engine Configure TTS properties (optional) Use save_to_file() to create a temporary WAV file Convert or copy the file to desired format Creating the Base WAV File First, let's create ...

Read More

How to Save File with File Name from User Using Python?

Rohan Singh
Rohan Singh
Updated on 27-Mar-2026 3K+ Views

In Python, saving files with user-defined file names is a common requirement in various applications. By allowing users to specify the file name, we can provide them with a more personalized and customizable experience. This article will explain the process of saving files with file names provided by the user, using Python. Algorithm A general algorithm for saving file with file name from user is as follows: Prompt the user to enter the desired file name. ...

Read More

Flask form submission without Page Reload

Atharva Shah
Atharva Shah
Updated on 27-Mar-2026 4K+ Views

Form submission is a crucial part of web applications, but traditional form submissions require page reloads, which can feel slow and disrupt user experience. Flask, combined with AJAX, allows you to submit forms asynchronously without page reloads, creating a smoother and more responsive application. Basic Flask Setup Let's start with a basic Flask application structure ? from flask import Flask, render_template, request, jsonify app = Flask(__name__) @app.route('/') def home(): return render_template('index.html') if __name__ == '__main__': app.run(debug=True) Creating the Flask Backend Here's the ...

Read More

Get latest Government job information using Python

Atharva Shah
Atharva Shah
Updated on 27-Mar-2026 278 Views

Government jobs offer stability, good benefits, and secure career prospects. Finding the latest job notifications can be time-consuming when done manually. This article demonstrates how to automate the process of collecting government job information using Python web scraping techniques. Required Libraries We need two essential Python packages for web scraping ? pip install requests beautifulsoup4 Import the required libraries in your Python script ? import requests from bs4 import BeautifulSoup Web Scraping Algorithm The process involves these key steps ? Target identification − Find the government job ...

Read More

Get last n records of a Pandas DataFrame

Atharva Shah
Atharva Shah
Updated on 27-Mar-2026 2K+ Views

When working with large datasets in Pandas, you often need to examine the most recent entries. The tail() method provides an efficient way to retrieve the last n records from a DataFrame. Syntax DataFrame.tail(n=5) Parameters: n − Number of rows to return from the end (default is 5) Creating a Sample DataFrame Let's create a DataFrame to demonstrate the tail() method ? import pandas as pd data = {'Name': ['John', 'Mark', 'Alice', 'Julie', 'Lisa', 'David'], 'Age': [23, 34, 45, 19, ...

Read More

How to Run Two Async Functions Forever in Python

Rohan Singh
Rohan Singh
Updated on 27-Mar-2026 10K+ Views

Async functions, also known as coroutines, are functions that can be paused and resumed during their execution. In Python, the asyncio module provides a powerful framework for writing concurrent code using coroutines. In this article, we will explore how to run two async functions forever using different approaches in Python. Understanding Async Functions Async functions allow for concurrent execution of code without blocking the main thread, enabling efficient utilization of system resources. To define an async function in Python, we use the async keyword before the def statement. Within the async function, we can use the await keyword ...

Read More
Showing 971–980 of 21,090 articles
« Prev 1 96 97 98 99 100 2109 Next »
Advertisements