extracting sub_folders of a path in python using next(os.walk(path))[1]

77 Views Asked by At

I have a python program and in my program, I want to manipulate folder and subfolders. When I use subfolders = next(os.walk(src))[1] command, I get this error:

StopIteration

I have no idea about this error. I print the path before rising the error and the path is valid.

0

There are 0 best solutions below