better behaviour

This commit is contained in:
2023-02-08 22:54:14 +01:00
parent f51b230099
commit 691a2e400d
3 changed files with 26 additions and 2 deletions

View File

@ -3,6 +3,7 @@
from rich import print
from ziffers import parse_expression
import readline
EXIT_CONDITION = ("exit", "quit", "")
@ -12,8 +13,7 @@ if __name__ == "__main__":
expr = input("> ")
if expr not in EXIT_CONDITION:
try:
result = parse_expression(expr)
print(result)
print(parse_expression(expr))
except Exception as e:
print(f"[red]Failed:[/red] {e}")
else: