Some tips that you need to know before learning python (pure information, no nonsense)

Tips to know before learning Python

It is very important for subsequent learning, otherwise there will be some weird problems later, and it will be difficult to find solutions.Hehe, don’t ask me how I know this. I’ve stepped on many of them.

Uninstall software from your computer

I have been using the computer's own Control Panel to uninstall the software, but it cannot delete some empty folders and registry, resulting in Many problems arose later.

Recommended use: geek (the best software I have found so far)

[Baidu Netdisk link](Link: https://pan.baidu.com/s/1O9W2ZQJJolFyUPVTFQUXkA?pwd=8888
Extraction code: 8888)

Interpreters and editors

  • Python interpreter: used to interpret codes and translate computer language to computers (recommended to download from Python official website (domain name: Python.org))Right-click this computer and click Properties to view computer-related information. You can see whether your computer is a 64-bit or 32-bit system type.

  • Editor: Used to assist you in writing code, with automatic completion and prompt functions (Vs Code is recommended)

    Installation of Python interpreter

    image-20230101113521481

  1. Check Add Python.exe to PATH(Add python to environment variables)
  2. Select custom installation
⇓ \Downarrow

image-20230101114715146

⇓ \Downarrow

image-20230101115134261

⇓ \Downarrow

win+rEnter cmd to open the terminal

image-20230101120900927

Compiler (just install it in a fool-proof way)

Pay attention to selecting the global one (the second one)

pip command related (commands are executed in cmd terminal)

  • Python's pip is used to manage Python packages and supports operations on Python packages such as installation, uninstallation, and updates.

  • Download packagepip install 包名(You need to remember this commonly used term)

  • Uninstall packagepip uninstall 包名

  • View installed packagespip freeze

    Some tips about pip

    One-time pip source change
    pip install requests -i http://pypi.douban.com/simple/
    
    Permanently configure pip to change source Douban (recommended)
    pip config set global.index-url https://pypi.douban.com/simple/
    

    http may report an unsafe error (http → \rightarrow https)

All packages downloaded by the pip command are inD:\interpreter\python\Scripts (in Scripts in your python installation location)

about环境变量

concept

Environment variables refer to some parameters used in the operating system to specify the operation of the operating system: that is to say, the operating system uses environment variables to find some resources at runtime. For example, when linking, it helps the linker find the dynamic library (standard library) or when executing a command, it helps the user find the location of the command.

Path environment variable

Steps to add environment variables:

  1. Win+i opens settings and enter advanced system settings, click Advanced.

  2. Click Environment Variables to configure system variables (the one below). (User variables are also available, but system variables can be used by everyone, while user variables can only be used by administrators.)

  3. Find the path and edit it

    image-20230101132923075

  4. Edit (put the path to the executable file with the suffix exe inside)

    Effect

    Before configuration

    image-20230101133710365

    After configuration

    image-20230101133533450

Guess you like

Origin blog.csdn.net/jiuwencj/article/details/128512243