Skip to content

Commit

Permalink
Update walking_the_path.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss authored Jun 2, 2019
1 parent e2c7325 commit ac29a5a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions walking_the_path.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from pathlib import Path


def visit(path: Path, depth: int = 0) -> None:
for item in path.iterdir():
s = f"{' ' * depth}{item.name}:"
Expand All @@ -9,4 +10,5 @@ def visit(path: Path, depth: int = 0) -> None:
else:
print(f"{s} {item.stat().st_size:,} bytes")


visit(Path("."))

0 comments on commit ac29a5a

Please sign in to comment.