Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set your subtitle preferences in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please refer to our video player troubleshooting guide for assistance.

Debugging

00:00 Welcome to our third video about VIM. In this video, we will talk about debugging, and you will see that this video will be pretty short. We’ve learned that debugging is an important feature for a text editor or an IDE because it’s just something that, as a developer, you’re going to have to do a lot. So, switching back to our code here,

00:20 let’s say we have a little bug in here—something that is not actually in the way that we want it to be.

00:28 If I run this code now—now that we learned how to run it before—I don’t get the output that I expected, so my numbers are not being squared. I don’t really have a way to figure out what’s going on in terms of debugging using VIM. VIM just does not have this functionality built-in.

00:46 There are ways to extend the functionality of VIM—you can install plugins, et cetera, et cetera. Or you can use tools that come with Python, so the way to do this in here would, for example, be import pdb—the Python debugger—and then work forward from there.

01:00 I’m not going to go into this in this tutorial, but Real Python has a nice introduction for using pdb, so we’ll link to that in the notes of the video.

01:08 But the takeaway for this section here—for VIM—is that as an editor, while it’s very quick and you’d have access to it on all Unix systems, there’s just some very important features that it doesn’t come with by default.

01:21 And one of those—an important one—is debugging. So in this section, I’ve mentioned a bit that there’s ways to extend the functionality of VIM with plugins, and in the next section, I will show you how to easily improve the appearance and working with VIM in a way that actually does not yet need any plugins, but that already comes built-in.

01:41 However, you need to switch it on and you need to know about it, so in the next video, we’re going to take a look at that.

Martin Breuss RP Team on Feb. 19, 2020

Here’s the Real Python article on Debugging with pdb and the associated Video Course.

Become a Member to join the conversation.