From f05d866d844b57b9af9609d554040398f2c16f3e Mon Sep 17 00:00:00 2001 From: Samuel Sloniker Date: Wed, 30 Nov 2022 18:11:02 -0800 Subject: [PATCH] Don't use print --- bin/ls.py | 6 +++--- bin/ps.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/ls.py b/bin/ls.py index 29a281a..addd213 100644 --- a/bin/ls.py +++ b/bin/ls.py @@ -10,13 +10,13 @@ def get_app_class(template): try: for file in os.listdir(path): - print(file) + self.console.write(file) except OSError as e: try: os.stat(path) - print(path) + self.console.write(path) except OSError: - print(f"ls: cannot access '{path}': No such file or directory") + self.console.write(f"ls: cannot access '{path}': No such file or directory") self.exit() diff --git a/bin/ps.py b/bin/ps.py index b0dde1a..23994dc 100644 --- a/bin/ps.py +++ b/bin/ps.py @@ -5,7 +5,7 @@ def get_app_class(template): for pid, app in apps.items(): args = app.argv[1:] name = app.name - print(f'{pid} {name} {args}') + self.console.write(f'{pid} {name} {args}') self.exit() return App