Effective PyCharm Transcripts
Chapter: Debugging Python applications
Lecture: Your turn: Debugging
Login or
purchase this course
to watch this video and the rest of the course contents.
0:01
When you're debugging your code it's really important to have great tools to visualize and understand exactly what's happening
0:10
and view the entire state of your app and we saw the PyCharm debugger is pretty top-notch at that. So let's go take an existing application
0:18
and use debugging to understand its workflow. So over here in 7-debugging,
0:23
we've got math_tricks which is an existing little application that we're going to use we come down here into the core,
0:31
this is the part we're going to try to understand and what we have is we have two generator methods, this yield keywords
0:36
and generator methods are kind of weird you can think of them as restartable or pause and resume these methods
0:44
so really, really cool in the way they work, really efficient but also kind of funky to understand,
0:49
so what we are going to do is we're going to come down here and open up this project, open this in PyCharm,
0:56
and we're going to run it just to make sure everything is hanging together you should see something like this, so we're going to play with breakpoints,
1:04
we're going to use the visual debugger to step through and understanding the code flow and we're going to even alter the way the application runs
1:11
by changing some of its state, which makes it go down different paths in the if block and things like that. So, open up this project, these math tricks
1:19
and play with the debugger and see how it all works.