Pradeep Elance has Published 446 Articles

How to Create a Shared Directory for All Users in Linux?

Pradeep Elance

Pradeep Elance

Updated on 03-Nov-2023 03:46:34

29K+ Views

When multiple users need access to the same set of directories of files then we need to create shared folders to be used by the users. In Linux there is concept of users and groups which can be given certain level of permissions that will enable them to share the ... Read More

Python - Check if all elements in a List are same

Pradeep Elance

Pradeep Elance

Updated on 27-Aug-2023 03:49:01

24K+ Views

Sometimes we come across the need to check if we have one single value repeated in a list as list elements. We can check for such scenario using the below python programs. There are different approaches.Using for LoopIn this method we grab the first element from the list and use ... Read More

File Searching using Python

Pradeep Elance

Pradeep Elance

Updated on 26-Aug-2023 08:09:50

32K+ Views

Python can search for file names in a specified path of the OS. This can be done using the os module with the walk() function. This will take a specific path as input and generate a 3-tuple involving dirpath, dirnames, and filenames.In the below example we are searching for a ... Read More

Python program to find the IP Address of the client

Pradeep Elance

Pradeep Elance

Updated on 25-Aug-2023 00:22:01

46K+ Views

In this tutorial, we are going to find the IP address of the client using theĀ socket module in Python. Every laptop, mobile, tablet, etc.., have their unique IP address. We will find it by using the socket module. Let's see the steps to find out theĀ IP address of a device.Algorithm ... Read More

Add a key value pair to dictionary in Python

Pradeep Elance

Pradeep Elance

Updated on 23-Aug-2023 13:10:11

63K+ Views

Python dictionaries are an unordered collection of key value pairs. In this tutorial we will see how we can add new key value pairs to an already defined dictionary. Below are the two approaches which we can use.Assigning a new key as subscriptWe add a new element to the dictionary ... Read More

Generating random number list in Python

Pradeep Elance

Pradeep Elance

Updated on 22-Aug-2023 00:49:42

153K+ Views

There is a need to generate random numbers when studying a model or behavior of a program for different range of values. Python can generate such random numbers by using the random module. In the below examples we will first see how to generate a single random number and then ... Read More

How to Copy File Permissions and Ownership to Another File in Linux?

Pradeep Elance

Pradeep Elance

Updated on 27-Jul-2023 13:29:22

781 Views

Many times while taking back up of data from one location to another or configuring software, we need to maintain the same level of ownership and permission of the files. Creating those permissions and granting ownership to individual files can be error prone of done by typing commands for each ... Read More

How to Clear BASH Command Line History in Linux?

Pradeep Elance

Pradeep Elance

Updated on 26-Jul-2023 15:55:07

472 Views

As we execute various commands they get stored in a file called .bash_history. We can refer to this file later to find all the commands. Sometimes there may be sensitive information in bash commands. To remove the sensitive information, we may remove specific lines from the bass history file or ... Read More

XML Processing Modules in Python

Pradeep Elance

Pradeep Elance

Updated on 25-Jan-2021 07:51:34

847 Views

XML stands for "Extensible Markup Language". It is mainly used in webpages, where the data has a specific structure. It has elements, defined by a beginning and an ending tag. A tag is a markup construct that begins with < and ends with >. The characters between the start-tag and ... Read More

XMLRPC server and client modules in Python

Pradeep Elance

Pradeep Elance

Updated on 25-Jan-2021 07:51:19

3K+ Views

We can create our own cross-platform, language-independent server using the XML-RPC protocol.We use the SimpleXMLRPCServer to create the SimpleXMLRPCServer instance and tell it to listen for incoming requests. Next we define some functions to be part of the service and register those functions so that the server knows how to ... Read More

1 2 3 4 5 ... 45 Next
Advertisements