So I have a file system that I want to be able to check and update using python. my solution was os.walk but it becomes problematic with my needs and my file system. This is how the directories are laid out:
Root
dir1
subdir
1
2
3...
file1
file2
dir2
subdir
1
2
3...
file1
file2
...
The main directories have different names hence "dir1" and "dir2" but the directories inside those have the same name as each other and contain a lot of different files and directories. The sub directories are the ones I want to exclude from os.walk as they add unnecessary computing.
Is there a way to exclude directories from os.walk based on the directory's name instead of path or will I need to do something else?