Python Learning--python Introduction

Source: Internet
Author: User

First, a brief introduction to Python

Guido van Rossum, founder of Python (Guido van Rossum).

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

Current Python main application areas:

Cloud computing : The hottest language in cloud computing, typically using OpenStack

Web Development : A number of excellent web frameworks, many large Web sites are developed for Python. such as: Youtube,dropbox, watercress and so on. The typical web framework has Django

Scientific Computing, artificial intelligence : Typical library numpy, SciPy, matplotlib, Enthought Librarys,pandas

system Operation : The necessary language for operations personnel

Finance : Quantitative trading, financial analysis, in the field of financial engineering, Python is not only used, but also used the most, and the importance of the year. Reason: As a dynamic language Python, the language structure is clear and simple, the library is rich, mature and stable, scientific calculation and statistical analysis are very good, production efficiency is much higher than c,c++,java, especially good at strategy backtesting

graphical GUI: PyQT, Wxpython,tkinte

differences between the compiler and interpreter

compiler is the source program each statement is compiled into a machine language, and saved as a binary file, so that the runtime computer can directly run the program in machine language, fast

The interpreter is only one explanation of the machine language to the computer when executing the program, so it runs faster than the compiled program.

This is because the computer cannot directly execute the statements we write, it only knows the machine language (binary file)

The compiled type is: C,c++,go,swift,objec C,pascal

The explanatory type is: Javascript,python,ruby,php,perl,erlang

Mixed types are: java,c#

compiled vs explanatory type

Compiled type

Pros: Compilers typically have pre-compiled procedures to optimize code. Because the compilation is done only once, the runtime does not need to compile, so the program execution of the compiled language is highly efficient. Can be separated from the language environment can run independently.

Cons: After compilation, the entire module needs to be recompiled if modifications are required. When compiling the machine code according to the corresponding running environment, the porting between different operating systems will be problematic, and you need to compile different executables according to the operating system environment of the runtime.

Explanatory type

Pros: Good platform compatibility. Can be run in any environment, provided the interpreter (virtual machine) is installed. Flexible, modify the code to directly modify the line, you can quickly deploy, without downtime maintenance.

Cons: Every time you run, you have to explain it again, performance is not as good as the compiled language.

Dynamic language and static language
Usually we call dynamic language, static language refers to dynamic type language and static type language .

(1) Dynamic type language: Dynamic type language refers to the language of data type checking during run time, that is, when programming in a dynamic type language, you never have to specify a data type for any variable, and the language will record the data type internally when you assign it to a variable for the first time. Python and Ruby are a typical dynamic type language, and many other scripting languages, such as VBScript, are also dynamic type languages.

(2) Static type language: Static type language is just the opposite of dynamic type language, its data type is checked during compilation, that is, when writing a program to declare all variables of the data type, C + + is a static type language typical representative, other static type language also has C #, Java and so on.

Python interpreter

When we write the Python code, we get a text file that contains a python suffix named. py. To run the code, you need the Python interpreter to execute the. py file.

The Python interpreter has: Cpython,ipython,pypy,jython,ironpython

There are many interpreters, but the most widely used is CPython (and this is what I'm learning). If you want to be with Java or. NET platform interaction, the best approach is not to use Jython or IronPython, but to interact over the network to ensure the independence of each program.

* Above is some of my study notes, a lot of gold from the King's blog, this is my study and as a review of the article.

Python Learning--python Introduction

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.