I would like to know if it\'s possible to force os.walk in python3 to visit directories in alphabetical order. For example, here is a directory and some code that will walk
Yes. You sort dirs in the loop.
def main_work_subdirs(gl): for root, dirs, files in os.walk(gl['pwd']): dirs.sort() if root == gl['pwd']: for d2i in dirs: print(d2i)