Programming Articles

Page 58 of 2547

Python Script to Monitor Network Connection and saving into Log File

Mrudgandha Kulkarni
Mrudgandha Kulkarni
Updated on 27-Mar-2026 2K+ Views

Monitoring network connections is crucial for ensuring the stability and security of computer systems. Whether you're a network administrator or an individual user, having a way to track network connectivity and log relevant information can be invaluable. In this article, we'll explore how to create a Python script that monitors network connections and saves the data into a log file. By leveraging Python's built-in libraries like socket and psutil, we can develop a script that periodically checks network connectivity, captures details such as IP addresses, timestamps, and connection statuses, and stores them in a log file for future reference. ...

Read More

Python Script to Logout Computer

Mrudgandha Kulkarni
Mrudgandha Kulkarni
Updated on 27-Mar-2026 1K+ Views

Python can automate the logout process on different operating systems using system commands. This tutorial shows how to create cross-platform logout scripts for Windows, macOS, and Linux systems. Prerequisites Before creating the logout script, ensure you have Python installed on your system. Download it from the official Python website and follow the installation instructions for your operating system. The script requires administrative privileges on some systems, especially Windows. Ensure you have the necessary permissions to execute system logout commands. Method 1: Logging Out on Windows Windows uses the shutdown command with the /l flag to ...

Read More

Python script to get device vendor name from MAC Address

Mrudgandha Kulkarni
Mrudgandha Kulkarni
Updated on 27-Mar-2026 1K+ Views

In the world of networking, MAC addresses play a crucial role in identifying devices connected to a network. A MAC (Media Access Control) address is a unique identifier assigned to each network interface card (NIC). It consists of six groups of two hexadecimal digits, separated by colons or hyphens. This article explores how to create a Python script to retrieve the device vendor name from a given MAC address using two approaches: API-based lookup and local database lookup. Understanding MAC Addresses A MAC address consists of 48 bits (6 bytes) represented in hexadecimal notation. It is typically written ...

Read More

Python script to generate dotted text from any image

Mrudgandha Kulkarni
Mrudgandha Kulkarni
Updated on 27-Mar-2026 699 Views

In the digital age, manipulating images and creating artistic effects has become a common practice. One intriguing effect is the generation of dotted text from an image. This process involves converting the pixels of an image into a pattern of dots, creating an interesting visual representation of the original content. In this tutorial, we will explore how to create a Python script that can generate dotted text from any given image using PIL, NumPy, and Matplotlib libraries. Understanding Dotted Text Dotted text is a technique where the pixels of an image are replaced with dots of varying ...

Read More

Python Script to create random jokes using pyjokes

Mrudgandha Kulkarni
Mrudgandha Kulkarni
Updated on 27-Mar-2026 2K+ Views

Are you looking to add some humor to your Python scripts or applications? The pyjokes library allows you to effortlessly generate random jokes in various categories and languages. This article will show you how to install pyjokes, generate different types of jokes, and create a complete joke generator script. Installing pyjokes Before we can start creating random jokes, we need to install the pyjokes library using pip ? pip install pyjokes Note: pyjokes works offline and doesn't require an internet connection during execution. The jokes are included with the library installation. Basic Joke ...

Read More

Handling PostgreSQL BLOB data in Python

Jaisshree
Jaisshree
Updated on 27-Mar-2026 722 Views

PostgreSQL is an open-source, object-relational database management system that supports diverse data types including BLOB (Binary Large Object) data. BLOBs are used to store large binary files such as images, videos, audio files, and documents directly in the database. To work with PostgreSQL BLOB data in Python, we need the psycopg2 library, which provides a Python interface for PostgreSQL databases. Installation Install the psycopg2 library using pip − pip install psycopg2-binary Creating a Table with BLOB Column In PostgreSQL, use the BYTEA data type to store binary data. This data type can ...

Read More

Get a list of a Particular Column Values of a Pandas Dataframe

Jaisshree
Jaisshree
Updated on 27-Mar-2026 6K+ Views

A Pandas DataFrame is a two-dimensional data structure similar to spreadsheets or SQL tables. Often, you need to extract values from a specific column as a Python list for further processing or analysis. There are several methods to extract column values from a DataFrame ? Using .values.tolist() method Using .loc[] method Using .iloc[] method Using get() function Using .values.tolist() Method The .values attribute extracts the underlying NumPy array, and .tolist() converts it to a Python list. Syntax ...

Read More

Generating Random Integers in Pandas Dataframe

Jaisshree
Jaisshree
Updated on 27-Mar-2026 6K+ Views

Generating random integers in a Pandas DataFrame is a fundamental technique for data simulation, testing algorithms, and creating synthetic datasets. This article explores four different approaches to populate DataFrames with random integer values. Method 1: Using NumPy's randint() Function The most straightforward approach uses NumPy's randint() function to generate a matrix of random integers, which is then converted to a DataFrame ? import pandas as pd import numpy as np # Set dimensions rows = 5 cols = 3 # Generate random integers between 0 and 100 random_data = np.random.randint(low=0, high=100, size=(rows, cols)) ...

Read More

Python script that is executed every 5 minutes

Mrudgandha Kulkarni
Mrudgandha Kulkarni
Updated on 27-Mar-2026 12K+ Views

Automation and task scheduling play a crucial role in streamlining repetitive tasks in software development. Imagine having a Python script that needs to be executed every 5 minutes, such as fetching data from an API, performing data processing, or sending regular updates. Manually running the script at such frequent intervals can be time-consuming and prone to errors. That's where task scheduling comes in. In this tutorial, we will explore different approaches to schedule Python scripts to run automatically every 5 minutes, from simple loops to robust scheduling libraries. Using the time.sleep() Function One simple approach to running ...

Read More

Generating Basic Discrete Time Signals

Jaisshree
Jaisshree
Updated on 27-Mar-2026 2K+ Views

Discrete time signals are fundamental in digital signal processing for analyzing and interpreting digital data. Creating basic discrete time signals helps us understand and replicate common signal types such as unit step, impulse, ramp, and sinusoidal signals used in various engineering applications. Common Discrete-Time Signals Let us first understand the four main discrete-time signals that are essential in signal analysis. Unit Step Signal The unit step signal is a fundamental signal that represents 0 for negative time indices and 1 for zero and positive time indices. It's used to model switching operations and system responses. ...

Read More
Showing 571–580 of 25,469 articles
« Prev 1 56 57 58 59 60 2547 Next »
Advertisements