Getting started with Python

Source: Internet
Author: User
Preface

Before introducing python, let's review the concepts and differences between compiled and interpreted languages.

Computers can recognize only machine languages. Therefore, programs written in advanced languages must be translated into machine languages before computers can execute them.

There are two translation methods: Compilation and interpretation. The two methods only have different translation time.

Before executing a program written in a compiled language, a special compilation process is required to compile the program into a machine language file, such as an EXE file. If you want to run the program later, you do not need to re-translate it, you can directly use the compiled result (exe file). Because only one translation is performed and no translation is required during the runtime, the execution efficiency of the compiled language program is high, but it cannot be generalized, the interpreter of Some interpreted languages dynamically optimizes the code at runtime, and can even make the performance of interpreted languages exceed that of compiled languages.

The program of an explanatory language does not need to be compiled. It saves a lot of effort and can be translated only when the program is running. For example, an explanatory BASIC language has a special interpreter that can directly execute the BASIC program, each statement is translated only when it is executed. In this way, each execution of an explanatory language requires a translation, which is less efficient. The explanation is a sentence translation.

Compilation and interpretation have their respective advantages and disadvantages. Because the program runs fast and has low requirements on the system under the same conditions, it is used for operating systems, large applications, and database systems, compilation languages such as Java, C/C ++, and PASCAL/Object Pascal (Delphi, some programs such as web scripts, server scripts, and auxiliary development interfaces that do not have high speed requirements and have certain requirements on the compatibility between different system platforms usually use explanatory languages, such as JavaScript, VBScript, Perl, Python, Ruby, and Matlab
And so on.

Python Introduction

Python is an interpreted, object-oriented, and dynamic data type high-level programming language.

Baidu encyclopedia has a detailed introduction to the generation, style, design positioning, execution, advantages and limitations of Python.

Http://baike.baidu.com/view/21087.htm

Instance Hello world!

There are a lot of things to introduce. You can print "Hello World!" directly !" .

1. Download and install python. (The latest version is 3.3.2)

Http://www.python.org/download/releases/3.3.2/

2. Compile a python program.

After python is installed, an idle editor is automatically installed, and other text compilers can be used.

Create a new file helloworld. py in a directory

Enter the following content:

print "Hello World!"

3. Run

You can click run directly,

You can also enter helloworld. py in the command line.

You can run it.

(It is much simpler than Java. It does not need to be compiled into. Class, and Java XXX. Class is not required for running)

Preface

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.