In this example, you will learn to check the file size. Example 1: Using os module import os file_stat = […]

In this example, you will learn to check the file size. Example 1: Using os module import os file_stat = […]
In this example, you will learn to get the full path of the current working directory. Example 1: Using pathlib […]
In this example, you will learn to get file creation and modification date. Example 1: Using os module import os.path, […]
In this example, you will learn to find all files with .txt extension present inside a directory. Example 1: Using […]
In this example, you will learn to get line count of a file. Example 1: Using a for loop The […]
In this example, you will learn to get the file name from the file path. Example 1: Using os module […]
In this example, you will learn to extract extension from the file name. Example 1: Using splitext() method from os […]
In this example, you will learn to append to a file. Open file in append mode and write to it […]
In this example, you will learn to read a file line by line into a list. Example 1: Using readlines() […]
In this example, you will learn to copy the content of a file to another file using Python. Using shutil […]