Fool-proof installation and deployment of Python editor and Pycharm

A python tutorial written for my silly guy

There are surprises waiting for you
- Yanqiu

About this column

For information about Pythoninstallation 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

  1. win+RQuickly open the run box and enter cmdEnter
    Insert image description here
  2. Enter python, enter the Python environment interpreter, and display>>>Insert image description here
  3. Enter the code and press Enter to run
    Insert image description here

This method can only execute a single line of code at a time.
To exit the interactive interpreter, use exit, quitorCtrl+D

1.2 Use Notepad to write Python programs

  1. Create a notepad and enter the code
  2. Change the suffix name to .py, use the command in the "Command Prompt" program python+空格+路径to run it, as shown in the figure:

Insert image description here

Insert image description here

Insert image description here

2. Installation of Pycharm

PyCharm Integrated Development Tool (IDE) is the most frequently used tool software by Python developers around the world.

  1. Pycharm official website download address: https://www.jetbrains.com/pycharm/download/#section=windows
  2. Scroll down to find the community version ( Professionalit costs money)
    Insert image description here
  3. Click Downloadto download
  4. All the way Next(the download location can be changed) and thenFinish
    Insert image description here

Three Pycharm deployments

  1. OpenPycharmInsert image description here

  2. Check the box to agree to the user agreement
    Insert image description here
    Insert image description here

  3. Click Continueto enter the software
    Insert image description here

  4. ClickNew Project

Insert image description here

  1. Modify project storage location
    Insert image description here

  2. Check it Previously configured interpreter, thenAdd lnterpreter
    Insert image description here

  3. Select System Interpreter, and then only the Python environment can be recognized (if you do not find it manually), click OK,Create
    Insert image description here
    Insert image description here

  4. Right-click the folder———— New, Python Fileenter the name, and you can write the code
    Insert image description here
    Insert image description here

  5. Right click and runInsert image description here
    Insert image description here

Four basic usage tips of Pycharm

4.1 Modify theme color

Insert image description here
Insert image description here
Insert image description here

4.2 Modify font

Insert image description here
Insert image description here

4.3 Quickly modify font size

Insert image description here
Insert image description here
Double-click,
Insert image description here
press ctrl+mouse wheel,
Insert image description here
the same methodDecrease

Insert image description here
Be sure to pressApply
Insert image description here

4.4 Chinese plug-in

Insert image description here
Insert image description here
Just restart
Insert image description here

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. Insert image description here
When we encounter a word that we don’t know, right-click after selecting it——TranslateInsert image description here
Insert image description here

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

Guess you like

Origin blog.csdn.net/yanqiu12138/article/details/132841033