Day4. Initial knowledge of Python

Source: Internet
Author: User

First, Python introduction

Python advocates beauty, clarity and simplicity, and is an excellent and widely used language.

Python can be used in many fields, such as data analysis, component integration, network services, image processing, numerical computing, and scientific computing. Second, Python is a kind of python is an interpreted language, the code wants to run, must be executed through the interpreter. Python has several types of interpreters, each based on different languages, each with different characteristics, but with the ability to run our Python code properly.

CPython

When we downloaded and installed Python 2.7 from the official Python website, we immediately got an official version of the interpreter: CPython. This interpreter was developed in C language, so called CPython. Running Python at the command line is the start of the CPython interpreter. The CPython is the most widely used Python interpreter. All the code for the tutorial is also executed under CPython.

IPython

Ipython is an interactive interpreter based on CPython, meaning that Ipython is only enhanced interactively, but the functionality and CPython of executing Python code are exactly the same. Like many domestic browsers although the appearance of different, but the kernel is actually called ie. CPython uses >>> as a prompt, while Ipython uses in [ordinal]: as a prompt.

PyPy

PyPy is another Python interpreter whose goal is to perform speed. PyPy uses JIT technology to dynamically compile Python code (note that it is not interpreted), so it can significantly improve the execution speed of Python code.

Most python code can run under PyPy, but PyPy and CPython are somewhat different, which results in the same Python code being executed under both interpreters. If your code is to be executed under PyPy, you need to understand the differences between PyPy and CPython.

Jython

Jython is a Python interpreter running on the Java platform that compiles python code directly to Java bytecode execution.

IronPython

IronPython is similar to Jython, except that IronPython is a Python interpreter running on the Microsoft. NET platform that compiles python code directly into. NET bytecode.

Third, Python 2 or Python 3?

Although many companies in the industry are still using Python2.6 or 2.7 extensively, it is not easy to upgrade to 3.0 of the old project hundreds of thousands of or even millions of lines of code, but you will almost always use 3.x when developing new projects.

In addition Python3 really want to make a lot of improvements than 2.x, straight point of view, like from XP upgrade to Win7 feeling, the same stick.

The specific details of Py2 and Py3 are different from the rest of our course.

Iv. Characteristics of Python
    • 1. Easy to learn: Python has a relatively small number of keywords, simple structure, and a well-defined syntax to learn more easily.
    • 2. Easy to read: Python code definition is clearer.
    • 3. Easy maintenance: The success of Python is that its source code is fairly easy to maintain.
    • 4. An extensive standard library: one of the biggest advantages of Python is the rich library, cross-platform, compatible with Unix,windows and Macintosh very well.
    • 5. Interactive mode: Interactive mode of support, you can enter the execution code from the terminal and obtain the results of the language, interactive testing and debugging code snippets.
    • 6. Portable: Based on its open source features, Python has been ported (that is, making it work) to many platforms.
    • 7. Extensible: If you need a critical code that runs fast, or if you want to write some algorithms that you don't like to open, you can use C or C + + to complete that part of the program and then call it from your Python program.
    • 8. Database: Python provides the interface for all major business databases.
    • 9.GUI Programming: Python support GUI can be created and ported to many system calls.
    • 10. Embeddable: You can embed python in a C + + program to give your program's users the ability to "script".

Day4. Initial knowledge of Python

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.