Exceptions, Logging, and Debugging

Learning PathSkills: Python, Exceptions, Logging, Debugging, pdb

A person sitting in front of a computer, reading logs from a program, with an alarm light going off that indicates that an issue has been logged

Discover the essentials of Python exception handling, logging, and debugging. Explore logging, pdb debugging, raising exceptions, and built-in exceptions. Perfect for developers looking to enhance their code’s reliability and maintainability.

Exceptions, Logging, and Debugging

Learning Path ⋅ 6 Resources

Title image for Logging Inside Python (Logging in Python)

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.

Title image for Logging in Python (Logging in Python)

Interactive Quiz

Logging in Python

Title image for Python Logging: A Stroll Through the Source Code (Python Logging: A Stroll Through the Source Code)

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.

Title image for Debugging in Python With pdb (Python Development Tools Artwork)

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.

Title image for Using raise for Effective Exceptions (Python's raise: Effectively Raising Exceptions in Your Code)

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.

Title image for Python's Built-in Exceptions: A Walkthrough With Examples (Python's Built-In Exceptions: A Walkthrough With Examples)

Tutorial

Python's Built-in Exceptions: A Walkthrough With Examples

In this tutorial, you'll get to know some of the most commonly used built-in exceptions in Python. You'll learn when these exceptions can appear in your code and how to handle them. Finally, you'll learn how to raise some of these exceptions in your code.

Title image for Handling or Preventing Errors in Python: LBYL vs EAFP (LBYL vs EAFP: Preventing or Handling Errors in Python)

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.

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!

« Browse All Learning Paths