1. Preparatory work
- Install the Pycharm2017 version.
- The Python interpreter is installed on the computer
2. Local interpreter configuration
The steps to configure the local interpreter are relatively straightforward:
(1) Click the Settings button in the toolbar.
(2) In the Settings/preferences dialog box, select the Project interpreter page, choose the appropriate interpreter version in the drop-down list for project interpreter, or click the Settings button on the right to add it manually.
(3) In the next case, select the Add local option, and then select the expected interpreter (Python executable file).
It is worth mentioning that for some pre-defined virtual environments, it can also be added as an interpreter.
Configuration path: Settings > Project Interpreter
3. Configuration of Virtual Interpreter
(1) Open the Project interpreter page (by clicking the Settings button on the toolbar).
(2) Click the Settings icon and select Create Virtual environment.
(3) In the Create Virtual Environment dialog box, enter the name and location of the new virtual environment, along with the Python interpreter that the virtual environment relies on:
While it may take some time to create the virtual environment, Pycharm will give a progress bar to indicate the current creation process:
4. Configuration of third-party libraries and paths
Once you have configured your virtual environment, you will see all of the third-party libraries currently installed, Pycharm will list the version of each third-party library that is currently installed, and the latest version of the response, and you can decide whether to upgrade it:
In order to view the installation path, you can view all available Python interpreters by clicking the Settings button in the dialog box and selecting More, at this point:
5. Install Python third-party library
Action path: Settings > Project interpreter > "+" sign
Python shortcut key configuration
1. Theme
There is no doubt that Pycharm is an IDE with a powerful shortcut key system, which means that any action you make in Pycharm, such as opening a file, switching the editing area, and so on, can be accomplished by shortcut keys. Using shortcut keys not only improves the speed of the operation, it also looks very cool. However, if you are accustomed to using some shortcut key scheme, your fingers will become accustomed to change it is more difficult. This part of the tutorial is about how to tailor the Pycharm shortcut settings according to your habits, so you can use them handy.
For the basic shortcut key combination, usage is not mentioned here, details can refer to configuring keyboard shortcuts or Keymap.
2. Select a shortcut key configuration scheme
This is a very simple step, click the Settings button in the main toolbar and click Keymap in the Settings dialog box.
In the corresponding page drop-down list, select a shortcut key configuration scheme:
2, pycharm common shortcut keys1. Editor (Editing)
Ctrl + Space Basic code completion (classes, methods, properties)
Ctrl + Alt + Space quickly import any class
Ctrl + Shift + Enter statement completion
Ctrl + P parameter information (call parameters in method)
Ctrl + Q Quick View Document
F1 External Documents
Shift + F1 External document, go to Web document home page
Ctrl + Shift + Z---Redo Redo
Ctrl + Mouse Introduction/Enter code Definition
Ctrl + F1 Displays error descriptions or warning messages
Alt + Insert to generate code automatically
Ctrl + O Re-method
Ctrl + Alt + T selected
Ctrl +/Line comment/Cancel line comment
Ctrl + Shift +/Block Comment
Ctrl + W Select the added code block
Ctrl + Shift + W back to Previous state
Ctrl + Shift +/[SELECT code block end, start
Alt + Enter Quick fix
Ctrl + Alt + L code formatting
Ctrl + Alt + O optimize import
Ctrl + Alt + I Auto Indent
Tab/shift + Tab indent, not indent forward
Ctrl+x/shift+delete clipping the current line or selected code block to the Clipboard
Ctrl+c/ctrl+insert Copy the current line or selected code block to the Clipboard
Ctrl+v/shift+insert pasting from the Clipboard
Ctrl + Shift + V paste from the nearest buffer
Ctrl + D to copy the selected range or row
Ctrl + Y Deletes the selected row
Ctrl + Shift + J Add smart Line
Ctrl + Enter Smart wire cut
Shift + Enter Another line
Ctrl + Shift + U toggle between selected areas or blocks of code
Ctrl + DELETE Delete to character end
Ctrl + Backspace Delete to character start
Ctrl + numpad+/-Expand/collapse code blocks (current position: functions, comments, etc.)
Ctrl + SHIFT + numpad+/-expand/Collapse All code blocks
Ctrl + F4 Close the Running tab
2. Find/replace (search/replace)
F3 Next
Shift + F3 Previous
Ctrl + R Replacement
Ctrl + SHIFT + F or 2 strokes Shift Global Lookup {You can find a string in the entire project, such as looking up a function name string to see how the function was used before}
Ctrl + Shift + R global substitution
3. Operation (Running)
Alt + Shift + F10 run mode configuration
Alt + Shift + F9 Debug mode configuration
Shift + F10 Run
Shift + F9 Debugging
Ctrl + Shift + F10 Run editor configuration
Ctrl + Alt + R run manage.py task
4. Commissioning (Debugging)
F8 Skip
F7 Enter
Shift + F8 Exit
ALT + F9 Running cursors
Alt + F8 Validation expression
Ctrl + Alt + F8 Quick Validation expression
F9 Recovery Program
Ctrl + F8 Breakpoint switch
Ctrl + Shift + F8 View breakpoints
5. Navigation (Navigation)
Ctrl + n jump to class
Ctrl + Shift + n jump to symbol
Alt + right/left Jumps to the next, previous edit tab
f12 back to the previous tool window
esc back to the edit window from the tool window
Shift + esc Hide running, recently run Windows
Ctrl + Shift + f4 close active tabs
Ctrl + g View current line numbers, Word symbols
Ctrl + e&nbs p; the current file pops up, open the list of recently used files
ctrl+alt+left/right back, forward
ctrl+shift+backspace Navigate to the most recent editing area
Alt + f1 Find current file or identity
ctrl+b/ctrl+click jump to declaration
Ctrl + Alt + b Jump to implement
Ctrl + SHIFT + I view quick definition
Ctrl + SHIFT + B jump to type declaration
Ctrl + U Jump to Parent method, parent class
Alt + Up/down jump to Previous, next method
Ctr L +//Jump to code block end, start
Ctrl + F12 pop-up file structure
Ctrl + H type hierarchy
Ctrl + Shift + H method hierarchy
Ctrl + ALT + H Call Hierarchy
F2/shift + F2 Next, previous highlighted error
F4/ctrl + Enter edit resource, view resource
Alt + Home display navigation bar F11 bookmark Switch
Ctrl + Shift + F11 bookmark Mnemonic
Ctrl + #[0-9] jump to the identified Bookmark
Shift + F11 display bookmarks
6. Search related (Usage search)
Alt + F7/ctrl + F7 file query usage
Ctrl + Shift + F7 file usage highlighting
Ctrl + Alt + F7 display usage
7. Reconstruction (refactoring)
F5 copy F6 cut
ALT + DELETE Safe Delete
Shift + F6 Rename
Ctrl + F6 Change signature
Ctrl + Alt + N Inline
Ctrl + Alt + M extraction method
Ctrl + Alt + V Extract Properties
Ctrl + Alt + F extract Fields
Ctrl + Alt + C Extract Constants
Ctrl + Alt + p extract Parameters
8. Control Vcs/local History
Ctrl + K Submit Project
Ctrl + T Update project
Alt + Shift + C to see Recent changes
Alt + backquote (') VCs quick eject
9. Template (Live Templates)
Ctrl + Alt + J Current row using template
Ctrl +j Insert Template
10. Basic (General)
ALT + #[0-9] Open the appropriate tool window
Ctrl + Alt + y sync
Ctrl + Shift + F12 maximize edit switch
Alt + Shift + F add to Favorite
Alt + Shift + I check the current file according to the configuration
Ctrl + backquote (') Quick switch current plan
Ctrl + Alt + S Open Settings page
Ctrl + Shift + A Find all the actions in the editor
Ctrl + TAB to switch between windows
Python interpreter configuration and Python common shortcut keys