Oct-09-2020, 03:27 PM
If you want to visit the directories in order as well, you can also sort, but you have to sort the existing list, not return a new one.
Adding
Adding
dirs.sort()after the os.walk() call will sort the directories and then the processing of them will be in sorted order as well.