I have a folder structure as
>root
> foldername1
> subfoldername1
> subfoldername2
> subfoldername3
> foldername2
> subfoldername1
> subfoldername2
> subfoldername3
> foldername3
> subfoldername1
> subfoldername2
> subfoldername3
I would like to list all the file contained in the 'subfoldername3' of 'foldername2'
I approached the problem as follow, but since I have an incredible number of folders, subfolders, and files it takes forever to come to a conclusion.... is there a fastest way to do the same?
all_folders = [x[0] for x in walk(root)]
sub_folder = [s for s in all_folders if 'foldername2' in s]
matching_sub_path = [s for s in sub_folder if 'subfoldername3' in s]
matching_sub_path =
//root//foldername2//subfoldername3