diff --git a/term_utils.py b/term_utils.py index 9ba5466..efaa64b 100644 --- a/term_utils.py +++ b/term_utils.py @@ -37,8 +37,12 @@ class Term: time.sleep(1) def print(self, msg): - with open(self.tty, "w") as file: - file.write(msg) + try: + with open(self.tty, "w") as file: + file.write(msg) + return True + except PermissionError: + return False def print_creepy(self, msg): with open(self.tty, "w") as file: