Skip to content

dartmouth/debugging-in-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Freezing Time and X-Ray Vision: Debugging Superpowers in Python

Wondering why your code is not doing what it should be doing? Getting an error that you don’t understand? Ever wish you could hit pause on your code and see exactly what’s going on behind the scenes? In this hands-on, one-hour workshop, we’ll unlock your debugging superpowers in Python using Visual Studio Code (VS Code). Discover how to “freeze time” to inspect variables, set breakpoints, step through your code, and fix errors with confidence. We’ll dive into both basic and advanced debugging techniques with simple Python examples, giving you an x-ray vision of your programs in action.

Whether you’re new to debugging or want to sharpen your skills, this session will equip you to write and troubleshoot Python code more efficiently than ever before. All experience levels are welcome—bring your curiosity and get ready to level up your problem-solving toolkit!

Getting Started

Prerequisites

You should have the following installed:

Setup

  • Open this directory in VS Code.
  • Create a Python Virtual Environment:
    • Hit ⌘+⇧+p on a Mac or Ctrl+Shift+p on Windows to bring up the command palette at the top
    • Type Python create env and select Python: Create Environment...
    • Create a new venv and install dependencies from the requirements.txt

Usage

  • src contains all code examples for the workshop.
  • notes contains the speaker notes fo reach example.
  • ppt contains the introductory slide deck

Follow along during the session using the examples in src. You can find versions of the examples, where the bugs have been fixed in src/solutions (look for the comment starting with FIXME for an explanation).

Happy debugging!

Issues and feedback

If you run into any trouble working with these materials, have some questions about the content, or want to give general feedback, feel free to go through one of these channels to get in touch with us:

Licensing

Instructional materials created by Simon Stone for Dartmouth College under Creative Commons CC BY-NC 4.0 License. Creative Commons License

About

An introduction to debugging in Python with VS Code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published