First, the history of the development of programming languages
1, the programming language developed through the history of machine language, assembly language and high-level language in three stages, in which:
Machine language - binary numbers, computer and direct dialogue;
Advantages: high efficiency
Cons: Very low development efficiency
Assembly language - represent binary digits by the simple words, you can talk directly to the computer;
Advantages: Compared to develop high-efficiency machine language
Cons: Compared to the low efficiency machine language
High-level language - that is, high-level language programming language we now commonly used, can be roughly divided into two categories:
Compiled language:
- direct translation entire sections of code
Advantages: high efficiency
Disadvantages: low efficiency of development
Interpreted language:
- the code line by line translation
Advantages: development of high efficiency, run line by line help solve the bug, you do not need to execute every time the whole Code
Disadvantages: low efficiency
Learning difficulty and efficiency for: machine language, assembly language >>> >>> high-level language
From the development efficiency for: high-level language >>> >>> machine language, assembly language
Second, the environment variable
Environment Variables ---- all paths to find the file system configuration.
1, Python interpreter to download and install
The role of the Python interpreter - is to translate write their own code into a computer can recognize the language, the same as the equivalent of a translation machine.
Download python interpreter Click
2, the focus has been downloaded interpreter - configuration environment variable
After the start configuration environment variable to find the following files - right-click "My Computer", "property", "Advanced System Settings", "Environment Variables", double-click the "path" to add the following: 'E: \ python36' ---- - the folder where the file python.exe.
Then you can direct knock "python" in "cmd" to start the Python interpreter. Configuration as "pip" environment.
Environment configuration means you can find the corresponding file directly in the terminal "cmd" .
3, Python2,3 version coexistence
Two versions to download and install the same, you need to pay attention to is how to distinguish the two versions start
- Do not direct the coexistence of multiple versions of the original python.exe file, a copy of the renewed alias, python.exe and pip.exe are the same, you need to copy and rename, but do not delete the original.
Third, run the program and editor IDE development
1, the first run of a program
With the first program, it is necessary to run, which leads running in two ways:
a, interactive
Advantages: can immediately run results
Disadvantages: the code can not be saved permanently
b, the command line
Advantages: code files can be saved permanently
Cons: temporarily to run the code a bit of trouble.
Reasons - we need to enter "Python" code file and the corresponding location on the terminal in Notepad ++ "cmd", such as "python C: \ Users \ Think \ PycharmProjects \ untitled2 \ RNN sentiment analysis .py" intermediate "space"
With the program running the way, the next step is the main step program run:
1, the python interpreter read from the hard disk to memory - for ordinary files, click the word icon is equivalent to
2, the .py file is read from the hard disk to the memory - the equivalent of a click to read word document
3, python interpreter .py file content will be translated into the language of the computer can recognize
Note: The difference between the python interpreter and a plain text editor, the third step is --python interpreter translated syntax, text editor is a text display.
2, Pycharm download and install
a, how to use multiple versions on pycharm? Documents py_learn and untitled3 as shown are basic grammar and sentiment analysis required to test the contents, the corresponding version python3.6 and python3.7
Procedure: setting ----> Project Interpreter ----> show alls -----> "+" ----> After System Interpreter will see automatically pop up the corresponding python version
b, how to set the storage location .py files and documents? as the picture shows: