Category: Directories
Python: How to unzip a file | Extract Single, multiple or all files from a ZIP archive
In this article we will discuss different ways to unzip or extract single, multiple or all files from zip archive to current or different directory. In Python’s zipfile module, ZipFile class provides a member function to extract all the contents from a ZIP archive, Advertisements ZipFile.extractall(path=None, members=None, pwd=None) It accepts following arguments : path : …
Python: How to unzip a file | Extract Single, multiple or all files from a ZIP archiveRead More
Python : How to get the list of all files in a zip archive
In this article we will discuss different ways to get detail about all files in a zip archive like file’s name & size etc. Get the name of all files in the ZIP archive using ZipFile.namelist() In Python’s zipfile module, ZipFile class provides a member function to get the names of all files in it …
Python : How to get the list of all files in a zip archiveRead More
Python: How to create a zip archive from multiple files or Directory
In this article we will discuss how to create a zip archive from selected files or files from a directory based on filters. Python’s zipfile module provides a ZipFile class for zip file related stuff. Let’s use this to create a zip archive file. Advertisements First import the class from module i.e. from zipfile import …
Python: How to create a zip archive from multiple files or DirectoryRead More
Python Get list of files in directory with size
In this article, we will discuss different ways to get list of all files in a directory or folder along with size in python. Table of contents Get list of files (file paths) in directory with size. Get list of file names in directory with size. Get list of files (file paths) in directory and …
Python: Get list of files in directory sorted by date and time
In this article, we will discuss different ways to get list of all files in a directory / folder sorted by date and time in python. Table of contents Get list of files (file paths) in directory sorted by date. Get list of file names in directory sorted by date. Get list of files (file …
Python: Get list of files in directory sorted by date and timeRead More
Python: Get list of files in directory sorted by size
In this article, we will discuss different ways to get list of all files in a directory / folder sorted by size. Table of contents Get list of files (file paths) in directory sorted by size. Get list of file names in directory sorted by size. Get list of files (file paths) in directory and …
Python: Get list of files in directory sorted by sizeRead More
Python: Get list of files in directory sorted by name
In this article, we will discuss different ways to get list of all files in a directory / folder sorted by name in python. Table of contents Get list of files (file paths) in directory sorted by name. Get list of file names in directory sorted by name. Get list of files (file paths) in …
Python: Get list of files in directory sorted by nameRead 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, …
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, …