Python basic language - Lesson 1 5. Introduction to environment variables and windows environment variables, how to set environment variables, modify variables, delete variables, path environment variables

Programmer base 2021-10-14 04:37:37

Basic concepts of environment variables

  1. environment variable (environment variables) It is generally used in the operating system to specify some parameters of the operating system running environment , Such as : Temporary folder Location and System folder Location, etc .
  2. The operation of programming variables
    2.1 View environment variables
    Right click the computer ( This computer ), Select Properties
     Right click the computer ( This computer ), Select Properties

Select... On the left side of the system interface Advanced system setup

 Insert picture description here

Choose environment variables

 Insert picture description here

2. Add environment variables

Add environment variables through the new button
 Insert picture description here

Environment variables can have multiple values , Between values, use Separated by semicolons

 Insert picture description here

3. Modify environment variables

Modify the environment variables through the Edit button

 Insert picture description here  Insert picture description here

4. Delete environment variables
Delete environment variables by deleting the button
 Insert picture description here

path environment variable

path environment variable Save the path one by one

When we type a command on the command line , The system will first find... In the current directory , If so, just open it

If not, I will go to path The path to the environment variable , Until we find it . If it is not found, an error will be reported

We can add the path of some frequently accessed files or programs to the environment variable . So we can access these files anywhere

matters needing attention :

path Environment variables are not case sensitive path Path PATH

Use... Between multiple paths ; separate

Now let's Create a folder in the desktop as the environment variable

 Insert picture description here
Create a text in the variable (123.txt) The writing content is ( You opened it with an environment variable )

 Insert picture description here Then punch in the variable , find path Variable ,( because path Variable means path )
 Insert picture description here
 Insert picture description here
We now configure the number variable , Press win+R Open or run Right click to start running at point
 Insert picture description here Input cmd Point determination
 Insert picture description here  Insert picture description here
After this is, we can directly enter 123.txt You can open it directly

 Insert picture description here Then enter the following picture

 Insert picture description here This allows you to take advantage of the path( route ) Quickly open the file you want .

This concludes the tutorial , If you have any questions, please leave a message , I will reply in time or enter our communication group
 Insert picture description here

Please bring the original link to reprint ,thank
Similar articles