One, life is too short, I use the python "interpreter"

Source: Internet
Author: User

1 interpreter

Interpreter (English: Interpreter), also translated as a computer program, can be a high-level programming language line direct translation run. The interpreter does not translate the entire program at once, just like an "intermediary", and each time the program is run, it is turned into another language to run, so the interpreter's program runs slower. It runs at once with every translation of a single line of programming, then translates the next line, then runs, so it goes on.

Python, Tcl, and various shell programs are generally performed using the interpreter. Microsoft's QBasic language is also interpreted in a way that does not generate executable programs (but quick basic and Visual Basic can), while Java is interpreted and compiled using a wide range of network programming languages. It is important to emphasize again before you begin: The interpreter described below is a source code interpreter. That is, the interpreter reads a statement every time it executes, and executes a specific action based on that statement, and then reads the next statement, and so on. This is different from a pseudo-code interpreter, such as an earlier Java runtime system. The difference is that the source code interpreter executes the code of the program directly, and the pseudo-code interpreter translates the program's source code into some kind of machine-independent intermediate code before executing the intermediate code. In contrast, the source code interpreter is easier to create and does not require a separate compilation process.

1 # !/usr/bin/env python       indicates that the script is executed by the Python parser 2#  -*-coding:utf-8-*-     Tells the Python parser to execute the code with UTF-8 encoding, and the Python parser by default executes the code with Ascill encoding without specifying the encoding.  3   4print"Hello World!!! " "

The difference between 1.1 #!/usr/bin/env python and #!/usr/bin/python

#!/usr/bin/python is to tell the operating system to execute the script, call/usr/bin under the Python interpreter;

#!/usr/bin/env python is used to prevent operating system users from not loading Python into the default/usr/bin path. When the system sees this line, it will first find the Python installation path in the env settings, and then call the interpreter program under the corresponding path to complete the operation.

One, life is too short, I use the python "interpreter"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.