Python Jumpstart by Building 10 Apps Transcripts
Chapter: App 3: Birthday countdown app
Lecture: Summary and debugging with PyCharm

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Our app is finished, but let me show you a really cool feature a pie
0:03 charm that's going to help you throughout this course and we can also use that to
0:07 review what we've created so it's good and to remain method here now when you're writing
0:12 code, it doesn't always go as planned.
0:13 Sometimes you need tio inspected state and carefully look at what's happening a lot of times
0:19 you'll see people talking about the bugging python code using command line to buggers and other
0:24 things like that, but we don't do that reason pie time what we can do
0:27 is actually was just like click or right here in this what they call the gutter
0:30 and set a break point we could even set a couple of them one here and
0:33 one there if we go up here and we pressed the bug not the play but
0:36 the bug it will actually run in the two bugger and notice it's kind of here
0:41 and it's hit this breakdown and just stopped right?
0:44 So is sitting there waiting it would show us the variables that air there and stuff
0:47 like that when good are console and see the output like we saw before and we
0:51 can say step over this or we could step into this functional watch it go or
0:56 we could step into on lee our code so what's the difference here like if we
1:00 were working with parameters and stuff like that.
1:03 And they were being computed as part of this.
1:05 But there be computed, say,
1:06 inside of the pipe on framework and not our code.
1:09 That would just skip that step and go in there.
1:11 And if you happen to be inside a function,
1:13 you couldn't get out of it from there.
1:16 So let's, just step over this line that will go to the consul here.
1:19 Step over. We see this,
1:21 you know, maybe we want to learn more about this get birthday apartment that was
1:24 confusing so we could step into that.
1:26 And as we step down, you could see it,
1:28 prints out a little bit and then asked us the question.
1:30 So let's answer nineteen, seventy four now,
1:33 it's still in this line we've got a step let's.
1:36 Say eight and one more step.
1:39 All right, notice we've entered these three days here,
1:41 through values and to the right of the variable here.
1:45 It's. Not that, but it's just cause the variable here it has years.
1:48 Nineteen, seventy four months, eight and day is one that's really cool?
1:51 And if we go over to the to bugger,
1:53 we can actually see, like here are all the variables over here we can right
1:59 click and weaken, say, set value we could set this back to july feeling
2:03 notice it changes color to say this is not the natural value this is like something
2:07 you've done to it we take one more step we now have our birthday and it
2:11 even shows the birthday that the date representation over here so that's pretty cool so let's
2:17 step along here see your birthday shows it right there do another step it shows what
2:22 today is like i said september eighth and let's go ahead and suppose we could step
2:28 in here i guess and watch this go all right well come step along you see
2:32 there's our time delta if we look at the variable it says dt is a time
2:37 delta negative sixty nine days so we step along one more time and print out the
2:42 information and that is our app pretty cool let me show you that these could even
2:46 be a little more advanced if we'd right click on this i could say i want
2:49 the condition where a number of days that completion for the stuff right here that's awesome
2:56 okay this is equal to zero let me take away this break point notice that his
3:01 little question mark now so if i run this and i say nineteen seventy four for
3:06 this is not my birthday so this will not hit the break point now it didn't
3:11 like that did it i guess i got to do that one later here we go
3:18 no, just. It just gives,
3:19 tried over that break point and doesn't do anything because it's,
3:22 not my birthday. But if we do it again,
3:24 i come down here and i enter the right day.
3:26 Nine. Eight boom break point.
3:32 So you can do a lot of cool stuff with this to bugger with these break
3:34 points, things like that. So i definitely encourage.
3:37 You. Use this of leverages whenever you having problems with your code,
3:41 and it will help you understand it better by stepping through it.