Tips for using PyCharm

  • ctrl+alt+L, format code
  • alt+enter, Error universal key, different scenarios have different expressions, use the corresponding module that will import (install) on the module name that has not been imported (install), use supplementary comments on the method name, and use it in the test to help you supplement the assertion code...
  • ctrl+space, Universal prompt key, PyCharm will provide completion according to the context. Not only code prompts, ctrl+fbut when searching, you press it when you don’t know what to type, which often surprises you. Under Windows, this shortcut key cannot be used due to the input method. ctrl+alt+sOpen the settings and type keymap. Search for basic in the Keymap to find and modify it (change to shift+H)
  • Read Code Shortcuts
    • ctrl+q, check the notes
    • ctrl+shift+i, check the source code when there is no comment
    • ctrl+p, Check the parameters when calling the method, press it in the parentheses, you will know what parameters should be given at the current position, but because it is Python, it ctrl+spacecan also be used here to achieve good results
  • The last type of variable or expression .(点), after the prompt appears, see the bottom part with various code templates, such as the existing variable a, type a. (dot) print on the next line and then type tab, Python2 will become print a, Python3 will become print(a), as well as various commonly used code templates such as if and else
  • Double-click shift to search for everything, whether it is IDE functions, files, methods, variables... can be searched
  • Shortcut keys when writing code
    • ctrl + /quick note
    • ctrl + dCopy the line where the cursor is
  • Native editing, using the remote environment at runtime, saves the trouble of environment switching.

  • Know about sharing

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325562737&siteId=291194637