Skip to content

Latest commit

 

History

History

README.md

Error Handling

Small Python examples for error handling and debugging.

Contents

  • debugging_python.py - print debugging and pdb breakpoints
  • exception_handing.py - try/except/else/finally patterns with input prompts
  • raise_statement.py - raising, re-raising, and assertions
  • pycharm_debugger.py - PyCharm debugger notes with a simple example

Run

cd python/lessons/error_handling && python debugging_python.py
cd python/lessons/error_handling && python exception_handing.py
cd python/lessons/error_handling && python raise_statement.py
cd python/lessons/error_handling && python pycharm_debugger.py

Some scripts prompt for input or drop into pdb.

Debugging Notes

  • debugging_python.py triggers a pdb breakpoint; type n to step or c to continue.
  • Type q to quit the debugger.

Interactive Lessons

A PySide6 app with visual, hands-on versions of all lessons above.

cd interactive_lessons && python main.py

Features:

  • Exception Handling: Animated try/except/else/finally flowchart
  • Raise Statement: Exception propagation demos, custom exception examples
  • Debugging: Step-through debugger simulator with variable inspection
  • IDE Debugger: Breakpoint concepts, debugging workflow guide