The latest PyCharm basic use (2) ------ code editing (Edit), window view (View), jump, search, positioning navigation (Navigate)

3. File content undo (back), redo (forward), copy, paste, delete, find, insert, select, convert, merge, sort, transpose, etc. Edit 4. PyCharm's main window, sub-window (sub-window
) , partial window) operations
5. Navigation operations such as cursor jump, file jump, search, and file positioning in PyCharm

3. Undo ( Back ) , Redo ( Forward ) , Copy, Paste, Delete, Find, Insert, Select, Convert, Merge, Sort, Transpose, etc.

Edit menu _

        The options of PyCharm's Edit menu are shown in Figure 3-1. The Edit menu is mainly to undo (back), redo (forward), copy, paste, delete, find, insert, select, convert, merge the content of the file , sorting, transposition and other editing operations, the menu contains the operation options and shortcut keys for the file content. The options of the Edit menu are mainly to edit the content of the file window (code editing window, also known as the code editor, Code Editor) on the right side of the PyCharm window.

Figure 3-1 Edit menu of PyCharm

Undo

       To undo, to undo, ie to go back.

Redo

       Redo, that is, move forward.

Copy as Plain Text

       Copy as plain text.

Copy Path/Reference

       Copy path/reference, you can copy path or reference location in the pop-up menu.

Paste

        paste.

Delete

        delete.

Find

       Search, the menu of this option corresponds to the search, select (Select), replace (Replace) options. It is mainly for the search, selection or replacement operations in the file content, that is, to use strings to search and select in the file or alternative operations.

Find Usages

       The Find Usages function of PyCharm can find the place where a variable, function, or class is referenced, first select its name, and then find it through Find Usages, and the search information of the find window will appear at the bottom of PyCharm. There are other find operations in this option's menu.

Column Selection Mode

      Column selection mode, column alignment selection, that is, the mouse selects text vertically (column).

Select All

       Select all.

Add Carets to Ends of Selected Lines

       Insert symbols at the end of the selected line (carets, carets, which can be understood as symbols we use for certain needs). If you select this option after selecting multiple lines, you can insert a certain symbol at the end of multiple lines at the same time.

Extend Selection

        Extend selection. If you select this option after selecting the content, you can automatically expand the selection, for example: after selecting the defined method name, and then select this option, you can automatically select the entire area where the method is defined.

Shrink Selection

         Narrows down the selection, the opposite of Extend Selection.

Toggle Case

         Switch case, case conversion.

Join Lines

         Merge rows.

Duplicate Selection

         Copy the selection and add it after the selection.

Fill Paragraph

         Fill paragraphs and merge them into one paragraph, for example: continuous multi-line comments can be automatically filled into one paragraph.

Sort Lines

         Sort the selected rows, alphabetically.

Reverse Lines

        Reverse sort the selected lines, opposite to Sort Lines above.

Transpose

        Transpose, swap the position of the characters on both sides of the cursor (cursor).

Indent Selection

        The selection is indented to the right.

Unindent Line or Selection

        Indents the line or selection to the left.

Convert Indents

        Convert indentation, you can convert indentation to Spaces (blank) or Tabs (tab key)

Macros

       Macro, which can record the process of content editing. Macros can be played and modified after recording. Open any .py file and run a macro, and the same operation behavior (Action) as the macro can be completed in this .py file. This automatic operation behavior reduces our manual writing process and improves the editing speed. For the convenience of operation, you can also set the shortcut key for this macro to run in File→Settings→Keymap→Macros.

Bookmarks

      Bookmarks, when the code is too long, it is easy to find with the help of bookmarks. The left edge bar of the file window on the right side of pycharm (the vertical column on the left of the code area) generates a bookmark, put the cursor on the line of the bookmark, and press the F11 key to delete the bookmark.

Encode XML/HTML Special Characters

       Encode special characters of XML/HTML language to avoid error reporting. XML (Extensible Markup Language, Extensible Markup Language) can be used to mark data and define data types. It is a source language that allows users to define their own markup language.

Edit as Table

        Edit as a table.

Fourth, the operation of PyCharm's main window and sub-window (sub-window, local window)

View menu _

        The options of PyCharm's View menu are shown in Figure 4-1. The View menu is mainly for displaying and hiding visual information of PyCharm's main window and sub-windows (sub-windows, local windows). The menu contains window operation options and its shortcut key.

Figure 4-1 View menu of PyCharm

Tool Windows

       Tool window, there are many operating tools in the menu corresponding to this item, click the tool inside to pop up the corresponding tool window, for example: Commit corresponds to the sub-window of saving to the database information, and Project corresponds to the sub-window of project information.

Some tool names have been displayed around the main window of PyCharm, for example: the name buttons on both sides and bottom of the main window of PyCharm are tools.

Appearance

       Display, this option is to control the PyCharm window interface, control the window size, columns, controls, etc. For example: Appearance→Main Menu, the Main Menu is checked by default, if the Main Menu is not checked, the title bar of PyCharm's File, Edit, View, etc. will be hidden, the interface will not display the title bar, and the cursor will be drawn to the top to display The title bar.

Quick Definition

        When the cursor selects a built-in expression in the code (for example: a built-in function of python), an information window for explanation will pop up.

Quick Type Definition

         The cursor selects the name in the code (for example: variable name), and an information window for explaining the type will pop up.

Quick Documentation

        If a certain content is selected, the Quick Documentation option appears in Figure 4-1. If you select this item, an information document explaining the explanation will pop up with a more detailed description.

External Documentation

      If a certain content is selected, the External Documentation option will appear in Figure 4-1. Select this option to display the linked explanation information document, which has a more detailed description.

Parameter Info

       When calling a function or method, put the cursor between the parentheses of the function or method, and then select this item, and the parameter information window will pop up.

Type Info

        You can view the types of variables, functions, methods, and related parameters, and pop up a more detailed type information window.

Context Info

        Context information, an information window associated with the content can pop up. The concept of the context of the computer (Context) is similar to the context of the Chinese article (the following can be deduced from the above). The relationship between them can make corresponding follow-up reactions and processing according to the operation results.

Error Description

         Put the cursor on the position where the error is indicated in red, and then select this item, and an information window of the cause of the error will pop up.

Recent Files

          Select this option to pop up an information window related to recent files.

Recently Changed Files

          Select this item to pop up the information window of the recently changed files.

Recent Locations

          Select this item, and an information window will pop up where the cursor stays on the file after opening the file.

Recent Changes

          Select this item to pop up the recently changed information window, such as: creating files, accessing and other records.

Compare With

         After opening the file on the right side of PyCharm, select this item, and the comparison information window will pop up, for example: the comparison of the codes of the two files.

Compare With Clipboard

          After opening the file on the right side of PyCharm, select this item to pop up an information window comparing with the contents of the clipboard.

Quick Switch Scheme

       Select this item, and an information window for quick switching schemes will pop up, for example: select the options in it to change the color of the interface, set shortcut keys, etc. These can also be set in the File menu, and this option provides a quick switching method .

Active Editor

     The active editor can configure the file editing window, such as: Show Line Numbers of the menu is selected by default, and the editing window of the file opened on the right side of PyCharm will display the line number. When writing code, it is convenient for us to see the code. number of rows at .

Bidi Text Base Direction

       The base direction of the text for bidirectional text. This option is to choose the direction of bidirectional text. Bidirectional text is a string containing two texts, including both left-to-right text and right-to-left text.

Scientific Mode

       Scientific mode, a PyCharm window layout, select this option, the PyCharm main window displays the default more scientific sub-window layout.

Five, cursor jump, file jump, search, file positioning and other navigation operations in PyCharm

Navigate menu _

       The options of PyCharm's Navigate menu are shown in Figure 5-1. The Navigate menu mainly provides PyCharm with operations such as cursor jump, file jump, search, and file positioning. It has the functions of fast positioning and presentation. The menu is the navigation operation option and its shortcut keys.

Figure 5-1 Navigate menu of PyCharm

Back,Forward

        Back, forward, mainly the jump of the cursor click position, for example: multiple files are opened on the right side of the pycharm window, after clicking the file title, you can use this option to jump between files, when the cursor clicks multiple positions in the file content , you can also use this option to make the cursor jump between these multiple positions.

Search Everywhere

        Search in the default scope of Pycharm. You can enter the name to search, so as to quickly locate and open the file.

Class

        To search for a class in a certain range, you can enter the class name to search, so as to quickly locate and open the file.

File

        To search for files in a certain range, you can enter the file name to search, so as to quickly locate and open the file.

Symbol

        Use a string to search in a certain range, you can search for file names, variable names, function names, etc.

Line:Column

        Use the number of rows and columns to search in the currently opened file, and the cursor is positioned at this position.

Next Highlighted Error

       The next highlighted error. Locates the location of the next error in the currently open file.

Previous Highlighted Error

       Previous highlighted error. Go to the location of the last error in the currently open file.

Last Edit Location

      Last edit location. The current cursor is automatically positioned at the last edited position, that is, the last edited position.

Next Edit Location

      Next edit position. The current cursor is automatically positioned to the next editing position.

Navigate in File

       Navigate in the opened file, for example: when the cursor is placed in the middle of parentheses, and there are many lines between the parentheses, select Move Caret to Matching Brace in the option menu to quickly locate the start and end of the parentheses end position.

Select In

       Select and locate in the specified option, the option has a corresponding menu, select the option in the menu to locate.

Jump to Navigation Bar

       Jump to the navigation bar, for example: jump to the file name position of the project navigation bar that pops up on the upper left side of the Pycharm window in the current file.

Declaration or Usages

        statement or use. Jump to the statement or usage window according to the name where the cursor is located. For example, if the cursor is placed at the position of the built-in function name, select this option to jump to the corresponding description. When the cursor is placed on the name of the file, you can jump to the name Usage window.

Implementation(s)

       Implementation, you can jump to the window of the name implementation. For a python file, place the cursor at the position of the name in the file (or select the name in the file), and then select this item, it will jump to the corresponding __init__.py, module file or .pyi file, and you can view the name of the file Information such as description, code, or definition framework. For example: place the cursor on the Numpy library name in the file, and then select this item, it will jump to __init__.py, which will show which subjects in the library can be called. If the name does not exist Implementation(s), it will prompt that it is not found.

         A .pyi file is a stub file generated for a module that provides Python with a special extension. The 'i' in .pyi stands for interface (interface), and .pyi only provides the basic definition frame information, replace the specific content with ..., and specify the return value type with ->. For example: select the open function name, and then select this item, it will jump to the stub file of builtins.pyi, which contains the definition framework information of open.

         builtins.py is a module in Python that provides direct access to all of Python's built-in identifiers (built-in names), no imports required. builtins.pyi is a stub file for builtins.py.

Type Declaration

        Type Declaration, select this option (command) to jump to the type declaration of the symbol. For a python file, after placing the cursor at the position of the name in the file (or selecting the name in the file), and then selecting this item, it will jump to the corresponding .pyi file, and you can view the definition framework information of the type corresponding to the name. For example: place the cursor at the variable name position in the file, and then select this item to jump to the definition frame information of the corresponding type in builtins.pyi. If there is no Type Declaration for the name, no jump will be made.

Super Method

       super method. When the cursor is placed in the class, you can jump to the information corresponding to the parent class. This option is suitable for cursor jumping between the subclass and the parent class in the code. For example: put the cursor in the method name of the subclass, and then select this item, the cursor will jump to the method name of the same name of the parent class, place the cursor in the class name of the subclass, and then select this item, the cursor will jump to the parent class of the class name.

Test

        When the cursor is placed in the class of the code, this option will be displayed. Select this option to generate a test class, which is equivalent to generating a similar class, which is generally suitable for testing instance methods. When running this test class, the methods in the class can be executed automatically, and there is no need to write the instantiation code of the class and the method. The content of the default method of the test class is self.fail(), so the default test prompts the test result of failure exception, and you can change the code in the method body according to your own needs for testing.

Related Symbol

        Navigate to the relevant symbol. Navigate between files with complex relationships, e.g. use this option to navigate between views and templates.

File Structure

         file structure. It can display the main composition of the contents of the opened file, such as: the variable and method composition of the class in the file code.

File Path

         file path. Can display the directory status of the path where the current file is located.

Type Hierarchy

         Type hierarchy. Displays the hierarchical structure of the class where the cursor is located, and can browse the inheritance relationship of subclasses and parent classes.

Method Hierarchy

         Method hierarchy. Displays the hierarchical structure of the method where the cursor is located, and can browse the calling situation of a method.

Call Hierarchy

         Call hierarchy. Display the calling status corresponding to the cursor position. Call means call in computer.

Finally, you are welcome to like, bookmark, and follow!

Guess you like

Origin blog.csdn.net/thefg/article/details/129225710