A Python module that intercepts uncaught exceptions and explains them in plain English, with syntax highlighting and exact source context.
Import the module and call install().
From that point on, uncaught exceptions will be intercepted and translated.
import simarpreet_error_translator as et
et.install()
# Any uncaught exception below will be translated
x = 10 / 0
The module replaces sys.excepthook with a custom handler,
capturing uncaught exceptions before Python prints its default traceback.
Error explanations are fetched from a hosted JSON file and cached locally for fast lookup by exception type.
The final stack frame is inspected and the exact line of code that caused the crash is printed.
Output uses ANSI escape codes for clarity when running in terminals.
There was an error: ZeroDivisionError You tried to divide a number by zero, which is mathematically undefined. Python says: division by zero File: main.py, line 6 >>> x = 10 / 0