What this code does is to exclude first few levels and work only with the deeper ones (depending on level specified in code).
I would like to achieve INVERTED function. That means i want to WORK WITH first levels and exclude deeper ones.
- Code: Select all
from itertools import islice
next(islice(iterable, n, n), None)
dir = r'test'
iterable = os.walk(dir)
for root, dirs, files in iterable:
for name in files: