Skip to content

Commit 3b3e49e

Browse files
authored
Updated variable name
1 parent dd329d5 commit 3b3e49e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Disk Usage Visualizer/disk_visualizer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ def get_dir_sizes(path="."):
1212
full_path = r"\\?\\" + os.path.abspath(full_path)
1313

1414
size = os.path.getsize(full_path)
15-
dir_name = os.path.relpath(root, path)
16-
dir_sizes[dir_name] = dir_sizes.get(dir_name, 0) + size
15+
dir_path = os.path.relpath(root, path)
16+
dir_sizes[dir_path] = dir_sizes.get(dir_path, 0) + size
1717
except (FileNotFoundError, PermissionError, OSError):
1818
continue
1919
return dir_sizes
@@ -40,9 +40,9 @@ def main():
4040
print(f"{'Directory':40s} | {'Size (MB)':>10s}")
4141
print("-" * 60)
4242

43-
for dir_name, size in sorted_dirs[: args.top]:
43+
for dir_path, size in sorted_dirs[: args.top]:
4444
size_mb = size / (1024 * 1024)
45-
print(f"{dir_name:40s} | {size_mb:10.2f}")
45+
print(f"{dir_path:40s} | {size_mb:10.2f}")
4646

4747
print("-" * 60)
4848
print("✅ Disk usage analysis complete.")

0 commit comments

Comments
 (0)