Python 3: working with files and digital assets/File/Traversal of a directory
Traversal of a directory
editOS Walk
editfrom os import walk
from os.path import join
for root_directory, \
directories, \
files \
in walk(
'/home/jupyter',
topdown=False
):
# For all files found
for file in files:
full_path_to_file: str = join(
root_directory,
file
)
# For all directories found
for directory in directories:
full_path_to_directory: str = join(
root_directory,
directory
)