exclude_prefixes = ['__', '.']
for dirpath, dirnames, filenames in os.walk(node):
    dirnames[:] = [dirname for dirname in dirnames if all([(dirname.
        startswith(string) is False) for string in exclude_prefixes]) is True]
os.walk without hidden folders