SaiKrishna Tavva has Published 107 Articles

What is the match() function in Python?

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 01-Sep-2025 15:00:48

18K+ Views

When we are working with string data in Python, it's sometimed necessary to check if certain patterns appear in a string. Python's re module contains many methods which are used for pattern matching in the given strings using regular expressions. What is match() function? The match() function in re module ... Read More

How to install a Python package into a different directory using pip?

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 01-Sep-2025 15:00:24

20K+ Views

In Python, pip is a standard tool which is used to install third-party packages in our system. By default, pip installs packages into the site-packages directory of the current Python environment but in some cases, such as restricted environments or creating portable apps, we may need to install packages into ... Read More

How to ignore hidden files using os.listdir() in Python?

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 01-Sep-2025 14:59:22

6K+ Views

When we are working with directories in Python, a clutter of hidden files can be created. Hidden files are created with a dot (.) on Unix-like operating systems and we can filter them easily. In this article, we will explore different methods to ignore hidden files using the os module ... Read More

How to delete a Python directory effectively?

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 01-Sep-2025 14:59:04

893 Views

When we are working with Python files or directories, we may often need to delete them to perform tasks such as cleaning up temporary files. Deleting directories isn't an easy task when compared with deleting files. In this article, we will explore all the different methods to delete a Python ... Read More

How to add new keys to a dictionary in Python?

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 01-Sep-2025 14:57:36

982 Views

In Python, a Dictionary is one of the data structures that contains key-value pairs enclosed in curly braces '{}'. It is a Mutable and unordered data structure. Before proceeding with adding new keys to a dictionary, first let's create a dictionary with key and values. Following is the example ... Read More

How to get specific nodes in xml file in Python?

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 01-Sep-2025 14:55:03

10K+ Views

XML is abbrivated as Extensible Markup Language which is used format to represent a structured data. It's is useful when we are exchanging information between two systems. In Python, the xml.etree.ElementTree module helps us to read and work with XML data. In this article, we will explore how to extract ... Read More

How do you get a directory listing sorted by creation date in Python?

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 01-Sep-2025 14:54:32

11K+ Views

When working with files in Python, it's often useful to sort them based on their creation time. For example, to find the most recently added file or to process files in the order they were created then we need sort them by the creation date. Python provides built-in methods such ... Read More

How to copy certain files from one folder to another using Python?

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 01-Sep-2025 14:53:40

3K+ Views

When we are working with files in Python we may need to copy only a certain type of file. Python makes this task simple and flexible by using built-in modules such as os and shutil and pathlib. Copying specific files using shutil and os modules When we want to copy ... Read More

How to merge two Python dictionaries in a single expression?

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 01-Sep-2025 14:52:24

236 Views

In Python, a Dictionary is a unordered and muttable data structure which stores data as a key-value pair. In some cases, we may need to merge two dictionaries into a single dictionary by using a single expression, in such scenarios python provides different methods. Using | Merge Operator The | ... Read More

How do I get an ISO 8601 date in string format in Python?

SaiKrishna Tavva

SaiKrishna Tavva

Updated on 16-Jun-2025 15:47:20

64K+ Views

The ISO 8601 standard defines an internationally recognised format for representing dates and times. ISO 8601 is a date and time format that helps remove different forms of the day, date, and time conventions worldwide. In this article, we will discuss several methods to get an ISO 8601 date in ... Read More

1 2 3 4 5 ... 11 Next
Advertisements