There are surprises waiting for you
- Yanqiu
Installation and deployment of Python interpreter Pycharm
About this column
For information about Python
installation and environment variable configuration, please check this column article Python Installation and Environment Variable Configuration Fool's Tutorial (September 2023)
A Python editor
1.1 Use the command prompt to write Python programs
win+R
Quickly open the run box and entercmd
Enter
- Enter
python
, enter the Python environment interpreter, and display>>>
- Enter the code and press Enter to run
This method can only execute a single line of code at a time.
To exit the interactive interpreter, useexit
,quit
orCtrl+D
1.2 Use Notepad to write Python programs
- Create a notepad and enter the code
- Change the suffix name to
.py
, use the command in the "Command Prompt" programpython+空格+路径
to run it, as shown in the figure:
2. Installation of Pycharm
PyCharm Integrated Development Tool (IDE) is the most frequently used tool software by Python developers around the world.
- Pycharm official website download address: https://www.jetbrains.com/pycharm/download/#section=windows
- Scroll down to find the community version (
Professional
it costs money)
- Click
Download
to download - All the way
Next
(the download location can be changed) and thenFinish
Three Pycharm deployments
-
Open
Pycharm
-
Check the box to agree to the user agreement
-
Click
Continue
to enter the software
-
Click
New Project
-
Modify project storage location
-
Check it
Previously configured interpreter
, thenAdd lnterpreter
-
Select
System Interpreter
, and then only the Python environment can be recognized (if you do not find it manually), clickOK
,Create
-
Right-click the folder————
New
,Python File
enter the name, and you can write the code
-
Right click and run
Four basic usage tips of Pycharm
4.1 Modify theme color
4.2 Modify font
4.3 Quickly modify font size
Double-click,
press ctrl+mouse wheel,
the same methodDecrease
Be sure to pressApply
4.4 Chinese plug-in
Just restart
4.5 Instant translation
Help us when writing code or reading comments. When we encounter English words that we don’t know, we don’t need to open a web search.
When we encounter a word that we don’t know, right-click after selecting it——Translate
4.6 Shortcut keys
ctrl + alt + s |
Open settings |
ctrl + d |
Copy current line of code |
shift +alt + 上/下 |
Move current line of code up/down |
ctrl + shift +f10 |
Run the current code file |