1. Prepare a project
Add a Python file to your project and enter some source code, such as:
2, go to the corresponding file, class, symbol
A powerful feature of Pycharm is the ability to jump to any defined location of a file, class, or symbol by name.
3. Jump to a file
Press Ctrl+Shift+N and type D in the window that pops up:
The drop-down list shown below contains all files with the letter D in their names. Here select DeeplyBuriedfile. py and press Enter to open the corresponding deeplyBuriedfile. py file:
4. Jump to class
Next we try to jump to a specific class definition. Press Ctrl+N and type O. Note that you can type * here to represent all the file names. The drop-down list lists all classes whose names contain the letter O and gives the full path:
Select Foo from the prompt list and press Enter, this time opening the file at the class declaration where the cursor is:
5. Jump to symbols
Next we try to jump to a particular member of the class. Press Ctrl+Alt+Shift+N and type a:
Select bar and press Enter to go to the corresponding definition:
6, jump window additional functions
You may notice that there are other controls in the popup window that give us extra functionality.
First, we show how to jump to files, classes, and symbols outside of the current project. Check the Include non-project Files /classes/ Symbols checkbox or press the relevant shortcut key to open the list of external prompts. Unlike the previous Suggestion List, this list contains the corresponding items in the external library that match the search criteria:
The next step is to display the current multi-matched items in a separate window, Find Tool Window, which is important when you are doing multiple searches. We also want to be able to save our search results for the next time:
Finally, you can specify which file type of search results you currently want to display by clicking on the funnel icon next to the prompt list:
Source: CSDN Blog post from SDK community (www.sdk.cn/)