1. Basic use
of Pycharm 1. Configure the Python interpreter for your Python project under Pycharm
1. Project: Current project name>Project Interpreter>add Local
-
Create Python files and Python modules under Pycharm
-
File>New>Python File
-
File>New>Python Package
-
-
Install Python third-party modules with Pycharm
1. Project: Current project name>Project Interpreter>Click the small green plus sign on the right
-
Pycharm basic settings, such as no tab, tab=4 spaces, font, font color, theme, footer
This header setting, display line number, etc. How to export and import custom settings.
-
Set menu font size: Appearance&Behavior>Appearance
-
Set Console&Terminal font size: Editor>Colors&Fonts>Console Font
-
Set file encoding: Editor>File Encodings IDE Encoding; Project
Encoding; Properties Files are all set to UTF-8
-
Modify the background color: Settings>Editor>Color&Fonts>General>under Text on the right
Select Default text>Modify Background color
-
Do not use tab, tab=4 spaces: Editor>Code Style>Python
-
Font, font color: Edit>Colors & Fonts>Python
-
Turn off automatic updates: Appearance & Behavior>System Settings>Updates
-
Script header setting: Edit>File and Code Templates>Python Script Note: Other
similar
-
Show line numbers: Edit>General>Appearance>Show line numbers Note:
2016.2 default display line number
10. The vertical bar on the right is the code specification of PEP8, and it is suggested that a line should not exceed 120 characters
. 11. Export and import your custom configuration: File>Export Settings, Import Settings -
-
Common shortcut keys, such as copy current line, delete current line, batch comment, indent, find and replace. 1. Query and configuration of common shortcut keys: Keymap
-
Ctrl + D: Duplicate the current line
-
Ctrl + E: delete the current line
-
Shift + Enter: fast line break
-
Ctrl + /: Quick comment (can batch comment after selecting multiple lines)
-
Tab: Indent the current line (multiple lines can be indented in batches)
-
Shift + Tab: Cancel indentation (can cancel indentation in batches after selecting multiple lines)
-
Ctrl + F: Find
-
Ctrl + H: replace
-
Ctrl + Minus: Collapse the current code block
-
Ctrl + Shift + Minus: Collapse the current file
2. Set shortcut keys
1. Set shortcut keys to modify font size -
-
Pycharm installs plugins, such as Markdown support, database support plugins, etc.
-
Plugins>Browse repositories (the one in the middle of the three buttons below)>Search
‘markdown support’>install
-
There are three options for View in the upper right corner. Generally, we use the left side in the middle to write, and the right side is real.
preview
-