So far, I've built the core foundation of the Interactive Debugging Tutor. The program successfully:
- Accepts user input through an interactive commond-lin einterface.
- Executes Python code safely using exec() inside controlled environment, where varibles persist between inputs
- Detects and classifies several common error types, including
SyntaxError,NameError,TypeError, andIndexError - Display the original Python traceback along with an explaination and hint based on a JSoN error map.
- Uses
coloramafor formatting terminal output andtracebackfor error capture.
I've tested it with multiple example cases for each error type, and the result match expectations, the tutor trints both the real error message and a clear explanation underneath.
Overall, things have gone very smoothly. The biggest challenge so far ws ensuring that variable definitions persist between commands. At first, evry new input ran in a fresh environment. Solving htat taught mre more about Python's exec() scope and how to manage namespaces safely. I also learned a lot about parsing tracebacks and formatting terminal output in a readable, encouraging way.
For the next checkpoint, I plan to:
- Add interactivity options like "Would you like a hint?" or "Show example fix"
- Implement error logging in a local JSON file to track user progress over time.
- Expand the error database (error_map.json) to include more specfic cases and examples.
- ValueError, ZeroDivisionError, KeyError, AttributeError
- Refine the output design for clarity, possible shortening tracebacks to focus only on the key message.