Python learning-Introduction to python and introduction to python

Source: Internet
Author: User

Python learning-Introduction to python and introduction to python

I. Brief Introduction to python

Guido van rosum, founder of python ).

Python can be used in many fields, such as data analysis, component integration, network services, image creation, numerical computation, and scientific computation.

Currently, python is mainly used in the following fields:

Cloud computing: The most popular cloud computing language, typical application OpenStack

WEB Development: Many excellent WEB frameworks and many large websites are developed in python. Such as Youtube, Dropbox, and Douban. Typical WEB frameworks include Django.

Scientific Computing, artificial intelligence: Typical library NumPy, SciPy, Matplotlib, Enthought librarys, pandas

System?Dimension: required language for O & M personnel

Finance: Quantitative transactions and financial analysis. In the financial engineering field, Python is not only in use, but also the most used, and its importance increases year by year. Reason: As a Dynamic Language Python, the language structure is clear and simple, the database is rich, mature and stable, scientific computing and statistical analysis are awesome, production efficiency is far higher than c, c ++, java, especially good at policy retest

Graphical GUI: PyQT, WxPython, TkInte

Differences between compilers and interpreters

Compiler, right? Every statement in the source program is compiled into a machine language and saved as a binary file. In this way, the computer can run the program directly in the machine language at a high speed.

The interpreter is interpreted one by one only when the program is executed as a machine language for the computer to execute, so the running speed is not as fast as the compiled program.

This is because the computer cannot directly execute the statements we write. It can only recognize machine languages (binary files)

Compilation types include: C, C ++, GO, Swift, Objec · C, Pascal

Interpreted types include JavaScript, Python, Ruby, PHP, Perl, and Erlang.

Mixed types: JAVA, C #

Compiler VS Interpreter

Compilation type

Advantage: the compiler usually has a pre-compilation process to optimize the code. Because only one compilation task is required and no compilation is required during runtime, the execution efficiency of compiled languages is high. It can run independently from the language environment.

Disadvantage: After compilation, you need to re-compile the entire module if you need to modify it. During compilation, machine code is generated based on the corresponding runtime environment. Porting between different operating systems may cause problems. You need to compile different executable files according to the runtime operating system environment.

Interpreted type

Advantage: good platform compatibility. The interpreter (Virtual Machine) is installed before running in any environment ). Flexible. You can directly modify the code when you modify it. It can be deployed quickly without downtime.

Disadvantage: it must be explained every time it is run. The performance is inferior to that of compiled languages.

Dynamic Language and static Language
Generally, Dynamic Language, static language refer to Dynamic Language and static language..

(1) dynamic type language: a dynamic type language is a language that performs data type checks during runtime. That is to say, when programming in a dynamic type language, you never need to specify a data type for any variable. This language records the data type in the internal part when you assign a value to the variable for the first time. Python and Ruby are typical dynamic language. Other scripting languages, such as VBScript, are dynamic language.

(2) static type language: the static type language is the opposite of the dynamic type language. Its data type is checked during compilation, that is to say, when writing a program, declare the Data Types of all variables. C/C ++ is a typical representative of the static type language, and other static type languages include C # and JAVA.

Python Interpreter

When writing python code, we get a text file containing python with the suffix ". py. To run the code, you need the python interpreter to execute the. py file.

Python interpreters include CPython, Ipython, pypy, Jython, and IronPython.

There are many interpreters, but Cpython is the most widely used one ). To interact with java or. Net platforms, it is best not to use Jython or Ironpython, but to interact through the network to ensure the independence of each program.

* The above are some of my study notes, many of which come from the blogs of Kingdom. This is my article on study and review.

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.