Visual Studio Code for Python Developers Transcripts
Chapter: Running and Debugging
Lecture: Debugging with Visual Studio Code

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Now that you've seen how to do it via the command line, in this video, I want to show you how quickly you could get
0:06 started with debugging your Python applications inside of Visual Studio Code. Before we start debugging,
0:12 there's a couple of things that I want to clean up really quick. First off, I want to remove this breakpoint statement that we added inside of
0:18 our router controller because we don't really need that anymore. Next, I want to make sure that we're in the right virtual environment.
0:25 I'm going to go down to the bottom right side of the screen and click on the status bar. In here, you'll notice, as we saw before,
0:32 it'll list all of the different virtual environments and Python interpreters that we have, but also that one with the star in it,
0:37 it shows us, well, this is the one that we're currently using and that's the right one. We'll close that really quick.
0:43 Next, I'm going to open up the command terminal. Now, I want to type in python-m pip list. I just want to make sure that I have all of
0:51 my dependencies from my requirements.txt file installed. Now that that's up and running and we know that's all good,
0:58 let's go ahead and start debugging. Now, on the left-hand side of my editor is where right now, you can see that I'm keeping my activity panel.
1:05 Inside of there, you should see an icon that looks like a bug with a little play sign next to it. If you hover over it, it should say, ""Run and Debug.
1:14 If I click on that, it opens the ""Run and Debug"" panel. Now, guess what I'm going to do? I'm going to press ""Run and Debug.
1:20 Now, what the Python extension for VS Code does is it gives us a couple of different debug configuration options. Do I want to debug a file?
1:28 Do I want to debug a model? Do I want to module? Do I want to remote attach? Or do I want to use one of the configurations that are
1:35 specific to one of these different web frameworks? Now, we are using FastAPI, but for this case, I just want to use Debug the Module.
1:43 I'm going to click on the module. I'm going to enter the name of our module. If you remember, it is PodcastAPI.
1:49 I'm going to hit ""Enter"" and then I'm going to go ahead and let VS Code do its thing. What you're noticing is happening in the terminal at
1:55 the bottom is that it's activated the virtual environment in a new window. It's not going to be able to run the application.
2:01 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
2:05 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
2:09 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
2:13 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
2:17 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
2:21 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
2:25 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
2:29 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
2:33 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
2:37 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
2:41 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
2:45 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
2:49 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
2:53 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
2:57 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
3:01 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
3:05 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
3:09 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
3:13 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
3:17 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
3:21 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
3:25 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
3:29 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
3:33 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
3:37 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
3:41 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
3:45 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
3:49 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
3:53 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
3:57 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
4:01 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
4:05 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
4:09 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
4:13 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
4:17 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
4:21 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
4:25 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
4:29 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
4:33 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
4:37 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
4:41 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
4:45 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
4:49 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
4:53 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
4:57 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
5:01 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
5:05 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
5:09 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
5:13 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
5:17 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
5:21 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
5:25 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
5:29 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
5:33 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
5:37 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
5:41 It's going to be able to run the application in a new window. It's going to be able to run the application in a new window.
5:45 It's going to be able to run the application in a new window.


Talk Python's Mastodon Michael Kennedy's Mastodon