Exceptions, Logging, and Debugging
Learning Path ⋅ Skills: Python, Exceptions, Logging, Debugging, pdb, raise, Built-in Exceptions, Error Handling
In this learning path, you’ll learn how to handle exceptions, log events, and debug your Python code. You’ll start with exception handling using raise and built-in exceptions, then explore Python’s logging module and its source code. Finally, you’ll learn to debug with pdb.
Exceptions, Logging, and Debugging
Learning Path ⋅ 7 Resources
Exception Handling
Learn how Python handles errors through exceptions. You’ll explore how to raise, catch, and work with both custom and built-in exception types.
Course
Raising and Handling Python Exceptions
Learn what an exception is and how it differs from a syntax error. You'll learn about raising exceptions, making assertions, and catching exceptions to change the control flow of your program using the try, except, else, and finally keywords.
Interactive Quiz
Python Exceptions: An Introduction
Course
Using raise for Effective Exceptions
Learn how to raise exceptions in Python, which will improve your ability to efficiently handle errors and exceptional situations in your code. This way, you'll write more reliable, robust, and maintainable code.
Interactive Quiz
Python's raise: Effectively Raising Exceptions in Your Code
Course
Working With Python's Built-in Exceptions
Learn the most common built-in Python exceptions, when they occur, how to handle them, and how to raise them properly in your code.
Interactive Quiz
Python's Built-in Exceptions: A Walkthrough With Examples
Course
Handling or Preventing Errors in Python: LBYL vs EAFP
Learn about two popular coding styles in Python: Look Before You Leap (LBYL) and Easier to Ask Forgiveness than Permission (EAFP). You can use these styles to deal with errors and exceptional situations in your code. You'll dive into the discussion on LBYL vs EAFP in Python.
Logging
Python’s logging module helps you track events and diagnose issues in your applications. You’ll learn to configure logging and explore how it works under the hood.
Course
Logging Inside Python
Learn why and how to get started with Python's powerful logging module to meet the needs of beginners and enterprise teams alike.
Interactive Quiz
Logging in Python
Tutorial
Python Logging: A Stroll Through the Source Code
Learn about how the Python logging package is designed from an OOP perspective. You'll walk line by line through the source code and become better equipped to know what your code is doing.
Debugging
When something goes wrong, you need to find and fix the problem. Learn how to use Python’s built-in debugger, pdb, to step through your code and inspect variables.
Course
Debugging in Python With pdb
Learn the basics of using pdb, Python's interactive source code debugger. pdb is a great tool for tracking down hard-to-find bugs, and it allows you to fix faulty code more quickly.
Congratulations on completing this learning path! You’ve learned to handle exceptions, log events, and debug Python code using pdb.
Continue your intermediate Python journey with the next learning path:
Learning Path
Classic Data Structures and Algorithms
20 Resources ⋅ Skills: Python, Data Structures, Stacks, Queues, Linked Lists, Hash Tables, Enums, Search Algorithms, Sorting Algorithms, Collections
You might also be interested in these related learning paths:
Got feedback on this learning path?
Looking for real-time conversation? Visit the Real Python Community Chat or join the next “Office Hours” Live Q&A Session. Happy Pythoning!
