Commit 16b341e 1 parent 198ac5d commit 16b341e Copy full SHA for 16b341e
File tree 3 files changed +24
-1
lines changed
3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
## [ 0.6.0] - 2022-11-13
8
8
### Added
9
9
- BaseNode: Rollback functionality to original state when there is error setting parent and children (backwards-compatible).
10
- - BaseNode and DAGNode: Type hints
10
+ - BaseNode and DAGNode: Type hints.
11
11
- BNode: Node class for Binary Tree.
12
12
- BTree Constructor: From list.
13
13
- BNode Iterator: Level-Order Iterator.
14
+ - Add Tips and Tricks to documentation (List Directory).
14
15
15
16
### Fixed
16
17
- DAGNode: Fix issue of duplicated parent constructor creating duplicated children.
Original file line number Diff line number Diff line change
1
+ # List Directory
2
+
3
+ To list directories recursively using bigtree, we can use the ` glob ` built-in Python package to extract a list of paths.
4
+
5
+ ``` python
6
+ import glob
7
+ from bigtree import list_to_tree, print_tree
8
+
9
+ # Get all directories recursively
10
+ path_list = []
11
+ for f in glob.glob(" ./**/*.py" , recursive = True ):
12
+ path_list.append(f)
13
+
14
+ # Construct tree
15
+ root = list_to_tree(path_list)
16
+
17
+ # View tree
18
+ print_tree(root, max_depth = 3 )
19
+ ```
Original file line number Diff line number Diff line change 1
1
|:bulb: | Tips and Tricks
2
2
===================================
3
3
4
+ .. include :: list_dir.md
5
+ :parser: myst_parser.sphinx _
6
+
4
7
.. include :: nodes.md
5
8
:parser: myst_parser.sphinx _
6
9
You can’t perform that action at this time.
0 commit comments