You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

11 lines
495 B

import os, sys
sys.stdout.reconfigure(encoding='utf-8')
root = r'D:\code\crm-api-docs'
for dirpath, dirnames, filenames in os.walk(root):
dirnames[:] = [d for d in dirnames if d not in ('.git', 'node_modules', '.vscode')]
rel = os.path.relpath(dirpath, root)
depth = 0 if rel == '.' else rel.count(os.sep) + 1
if depth <= 2:
indent = ' ' * depth
name = '.' if rel == '.' else os.path.basename(dirpath)
print(f'{indent}{name}/ ({len(filenames)} files)')