Effective PyCharm Transcripts
Chapter: PyCharm Projects
Lecture: Navigating within a project

Login or purchase this course to watch this video and the rest of the course contents.
0:03 So we've got our project open and we have it running, we've configured our sources route all these things and it's pretty much ready to go—
0:10 but this may be is a new project to us, we don't really know where all the pieces are and how they fit together
0:15 so let's look at some of the navigational elements within the editor. So we've seen that we can use our search everywhere
0:22 and I could find things like run, you can see there's a run method in a couple of locations here,
0:28 for example this run method, and there was a bunch of those, so what if I just want to go to this one, I want to see what that does.
0:35 If you hold down command on Mac or control on Windows or Linux, everything here becomes a hotlink
0:43 so these are all things that you can go and just jump to so I can go to print_header and just click on it and it takes us right there.
0:49 Notice, that would be the navigate to declaration or even the command b it says so this little printer header just shows us like silly snake concept,
1:00 so if we want to go to program guest.run command click again, there we are, if we want to see what the show_commands is,
1:06 now we're kind of done with the mouse we hit command b or it depends, there's a different function on Windows,
1:12 so here we'll go here and it says control b but it really depends on the key mapping that you select when you get started.
1:17 But we can navigate around these and it's really cool, we navigated within our class and within our little function here
1:24 so maybe we want to go back and we want to go to that print header again and we're printing this out, and notice
1:31 we're actually printing this out white green white, so we're printing like a green snake here so if you want to know what that looks like
1:40 just really quickly say copy this path, I'll run it over here in the new window oh yeah, we've got to have our virtual environment active
1:52 so I'll just run it and here, right click run and you can see it's kind of this lime green it's not a great green that comes out there
2:01 the little terminal down at the bottom, the colors are not always quite right but that's ok, we can x it out but you see we are getting this color here
2:09 so where does this color come from— well it turns out at the top if you look, this is coming from Colorama
2:14 and let's actually go to this white and see what that is. Look at that, so if we jump down here we can see that this is an Ansi foreground color code
2:25 and those are what the codes actually are, you want to know what defines light and black Ex well that's whatever 90 is in the Ansi color codes.
2:34 Okay, so we can navigate to anything, this is an external package that you saw PyCharm install as a dependency,
2:40 we can also come over here and just navigate straight to print, there is the print definition granted, it's not super interesting
2:47 because it's actually written in C and is imported as part of CPython, so not so much, but you can navigate into all the things up to the level of C
2:57 not down into the C runtime, but that's ok. So one other navigational thing that we can do is maybe we want to know where this is called
3:08 so we could navigate from it, by command b when we have the cursor on it or command clicking it, right click navigate to we can also go in the reverse,
3:19 so I can come over here and say find the usages of this and it says oh well, this is used in these various locations down here
3:26 it turns out this one is just used one time if you double click, it says right here. Not super interesting in this program,
3:35 but it does show us where it's used and if it was used 20 times we would be able to explore throughout the whole program
3:41 so you can see, we have our little basically turn your program into a set of hyperlinks to navigate through everything
3:47 by holding command or just straight navigation through the hotkeys, it's amazing.


Talk Python's Mastodon Michael Kennedy's Mastodon