FileHandling

How to delete the contents of a folder in Python?

File handling in Python programming is a skill every python developer must have. In this python article, we will learn to delete the contents of a folder in Python programming language. Table Of Contents Method 1 : Using OS module os.remove() os.unlink() Method 2 : Using shutil module Method 3: Using pathlib module Summary Method …

How to delete the contents of a folder in Python? Read More »

Get filename without extension from a path in Python

In this article, we will learn to extract the filename from a give file without the extension of the file. Table Of Contents Using rfind() method : Using splitext() method: Using the split() method: Using Basename() method : Using pathlib.Path.stem() method : A Pathname consists of name of the file, location at which the file …

Get filename without extension from a path in Python Read More »

Find the smallest file in a directory using python

In this article, we will discuss how to find the smallest file in a directory and its sub-directories using python. Table of contents Find the smallest file in a directory using python. Find the smallest file in a directory and its sub-directories using python. Get the smallest file in a directory using python In python, …

Find the smallest file in a directory using python Read More »

Python- Find the largest file in a directory

In this article, we will discuss how to find the largest file in a directory and its sub-directories using python. Table of contents Find the largest file in a directory using python. Find the largest file in a directory and its sub-directories using python. Get the largest file in a directory using python In python, …

Python- Find the largest file in a directory Read More »

Scroll to Top