def nonrecursive(path):
	"""Move through all files, directories, and subdirectories of a path"""
	paths = [path]
	while paths:
            dpath = paths.pop(0)
            yield dpath
            for name in os.listdir(dpath):
                    fullpath = os.path.join(path, name)
                    if os.path.isdir(fullpath):
                            paths.append(fullpath)
                    else:
                            yield fullpath
Move through all files, directories, and subdirectories of a path
recipes/Python/577724_Simple_recursive_functinonrecursive/recipe-577724.py