Get all files from directory
Tags: #python #naas #glob #pprint #snippet
Description: This notebook gives you the ability to get all files from a directory even in a sub-directory.
from os import path
dir_path = "" # If dir path is "", it will returned files from current folder
files = glob.glob(path.join(dir_path, "**"), recursive=True)
print(f"Total files and folders fetched:", len(files))