Skip to content

Commit 1cd2587

Browse files
committed
fix: improve output formatting
1 parent 801138c commit 1cd2587

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • implement-shell-tools/wc

implement-shell-tools/wc/wc.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@
3939
for key, value in results.items():
4040
total_results[key] = total_results.get(key, 0) + value
4141

42-
print(" ".join(map(str, results.values())), path)
42+
# print(" ".join(map(str, results.values())), path)
43+
print(" ".join(f"{value:>4}" for value in results.values())," ",path)
4344

4445
if len(paths) > 1:
45-
print(" ".join(map(str, total_results.values())), "total")
46+
# print(" ".join(map(str, total_results.values())), "total")
47+
print(" ".join(f"{value:>4}" for value in total_results.values())," total")
48+

0 commit comments

Comments
 (0)