Exploring Navigation and Search
What these tutorials are about
In this series of tutorials, we’re going to navigate around your code in the most efficient way. With the example code provided below you can try all of the features mentioned in these tutorials.
The tutorials are located in the ascending order: the first one describes the most basic navigation facilities of PyCharm, while the last ones relate to alternative ways of navigation.
The parts 1-5 use the same example code. The part 6 relates to Django and thus makes use of the code example from Step 4. Creating and Running Your First Django Project
Learning all the navigation features and capabilities is out of scope. With these tutorials you’ll learn the most important ways to navigate around your code by example.
Before you start
Make sure that:
- You are working with PyCharm. If you still do not have PyCharm, download it from this page . To install PyCharm, follow the instructions, depending on your platform.
This tutorial has been created with PyCharm version 2017.1.
- You have created a project.
Preparing an example
Do the following:
- Add directory
Animalsunder your project root (Alt+Insert | ).
- Create the following Python files (Alt+Insert | ):
- Open these files for editing (F4) and add the following code:
from Animals.Carnivorae import Carnivorae from Animals.Herbivorae import Herbivorae class Mammalia(object): extremities = 4 def feeds(self): print ("milk") def proliferates(self): pass class Marsupialia(Mammalia): def proliferates(self): print("poach") class Placentalia(Mammalia): def proliferates(self): print("placenta") class TasmanianDevil(Marsupialia, Carnivorae): pass class Duckbill(Marsupialia, Herbivorae): pass class Cat(Carnivorae, Placentalia): pass class Tiger(Placentalia,Carnivorae): pass class Cow(Placentalia, Herbivorae): pass Cat.feeds()
from Animals.Mammalia import Mammalia class Carnivorae(Mammalia): def food(self): print("meat") pass
from Animals.Mammalia import Mammalia class Herbivorae (Mammalia): def food(self): print("grass") pass
Let's begin with Part 1 and explore the most basic and often-used means of navigation.