DB
Size: a a a
DB
DB
JW
DB
DB
DB
DB
In [15]: paths = glob.glob('C:\TEMP\**\*.py', recursive=True) In [16]: set(path.rsplit('\\', 1)[0] for path in paths)DB
DB
DB
In [15]: paths = glob.glob('C:\TEMP\**\*.py', recursive=True) In [16]: set(os.path.dirname(path) for path in paths)JW
tree /home/ape364/ -R -P "*.py" --pruneJW
A
tree /home/ape364/ -R -P "*.py" --pruneDB
def show_tree(path, file_ext):
for root, dirs, files in os.walk(path):
level = root.replace(".", "").count(os.sep)
indent = " " * 4 * (level)
print(f"{indent}{os.path.basename(root)}/")
subindent = " " * 4 * (level + 1)
for f in files:
if f.endswith(file_ext):
print(f"{subindent}{f}")
DB
DB
JW
A
tree /home/ape364/ -R -P "*.py" --pruneJW