The code fills in the blanks automatically
The problem
When using pyCharm’s code editor, I often don’t bother to write Spaces, as shown below, but this is not in compliance with the code specification and also affects readability.
The solution
Pycharm has a shortcut to format the code automatically. By default, Alt+Ctrl+L fills the code with Spaces when the shortcut is pressed.
Automatic alignment code
The problem
When using pyCharm’s code editor, there were times when the copy code was not aligned to the code format, as shown below, but this was not in compliance with the code specification and also affected readability.
The solution
Pycharm has a shortcut to format your code automatically. The default is Alt+Ctrl+L. Place the cursor on the line you want to format, or select an area and press the shortcut to align your code automatically.
Select all the same characters
Shortcut key combination: Ctrl + Shift + Alt + J
Select the next same character
Shortcut key combination: Alt + J
Batch indentation
Select the code area TAB to unindent shit+TAB
Select and press Tab:
other
Pycharm has a number of shortcuts that you can use as follows:
Referencecard. PDF can be found in PyCharm /opt/ PyCharm -3.4.1/help
Here are some of the more common shortcuts to tweaking code
PS: If you need Python learning materials, please click on the link below to obtain them
Free Python learning materials and group communication solutions click to join