MCPcopy Create free account
hub / github.com/ActiveState/code / tree

Function tree

recipes/Python/577091_Windows_TREE_Emulator/recipe-577091.py:13–19  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

11 print('Usage: {} <directory>'.format(os.path.basename(sys.argv[0])))
12
13def tree(path):
14 path = os.path.abspath(path)
15 dirs, files = listdir(path)[:2]
16 print(path)
17 walk(path, dirs, files)
18 if not dirs:
19 print('No subfolders exist')
20
21def walk(root, dirs, files, prefix=''):
22 if FILES and files:

Callers 1

mainFunction · 0.70

Calls 3

listdirFunction · 0.85
printFunction · 0.85
walkFunction · 0.70

Tested by

no test coverage detected