What is Python?

Source: Internet
Author: User

Python (Boa python) is an interpretive, object-oriented, high-level programming language with dynamic semantics.

In 1989, a Python language was designed to pass time by a Guido van Rossum (Van Rossum), and the first release was published in 1991.

Python is a purely free software, and the source code and interpreter CPython all follow the GPL (GNU general public License) protocol.

The Python syntax is clear and concise, and the most distinctive feature is the indentation of the statement with whitespace characters.

Python has a powerful and rich library of classes, often referred to as glue language, and can be combined with modules written in other languages (C + +). A common scenario is to use Python to quickly build a prototype of a program, and then part of it needs to have a particularly high requirement that needs to be rewritten in other languages. For example, the graphics rendering in 3D games needs to be written in C + +, and then encapsulated into a. py extension class library called by Python. The need to be aware of the use of extension types requires consideration for cross-platform.

  Advantages:

1. Simple: Python is a language that represents the idea of simplicity.

2. Easy to use: Python is easy to get started with, because it has a simple and easy-to-read document.

3. Fast: Fast, because the standard libraries and third-party libraries in Python are written in C, so soon.

4. Free, open Source: Python is one of the floss (free/source software) that allows users to freely publish copies of the software, read its source code, make changes to it, and use it as part of the new free software. Floss is the concept of sharing knowledge based on a group.

5. High-level languages: When writing programs in the Python language, you do not have to consider the underlying details such as how to manage the memory used by your program.

6. Portability: Because of its open source nature, Python has been ported on many platforms (modified to enable it to work on different platforms). These platforms include Linux, Windows, FreeBSD, Macintosh, Solaris, OS/2, Amiga, AROS, as/400, BeOS, os/390, z/OS, Palm OS, QNX, VMS, Psion, Acom RISC OS, VxWorks, PlayStation, Sharp Zaurus, Windows CE, PocketPC, Symbian, and Google Linux-based Android platforms.

7. Explanatory: A program written in a compiled language such as C or C + + can be converted from a source file (i.e. C or C + +) to a language used by your computer (binary code, i.e., 0 and 1). This process is done through the compiler and different tags and options. When you run the program, the connection/reprint software copies your program from the hard disk into memory and runs. Programs written in the Python language do not need to be compiled into binary code. You can run the program directly from the source code. Inside the computer, the Python interpreter translates the source code into an intermediate form called bytecode, and then translates it into the machine language used by the computer and runs it. This makes it easier to use Python. It also makes Python programs easier to migrate.

8. Object-oriented: Python supports both process-oriented programming and object-oriented programming. In a "process-oriented" language, a program is built from a procedure or simply a function of reusable code. In "Object-oriented" languages, programs are built from objects that combine data and functionality.

9. Extensibility: If you need a piece of critical code to run faster or you want some algorithms to be private, you can write some programs in C or C + + and then use them in a Python program.

10. embeddable: Python can be embedded in a C + + program to provide scripting functionality to program users.

11. Rich libraries: The Python standard library is really huge. It can help with all kinds of work, including regular expressions, document generation, unit tests, threads, databases, Web browsers, CGI, FTP, e-mail, XML, XML-RPC, HTML, WAV files, cryptography systems, GUI (graphical user interface), TK, and other system-related operations. This is called Python's "fully functional" concept. In addition to the standard library, there are many other high-quality libraries, such as Wxpython, twisted, and Python image libraries, and so on.

12. Canonical code: Python uses forced indentation to make the code more readable. Programs written in the Python language do not need to be compiled into binary code.

Disadvantages:

1. Single-line statements and command-line output problems: Many times you cannot write a program to a line, such as import sys;for I in Sys.path:print i. Perl and awk do not have this limitation, it is easier to complete a simple program under the shell, do not need to like Python, the program must be written to a. py file.

2. Unique syntax: This may not be referred to as limitation, but it is also confusing for many beginners by narrowing the way in which the statement relationship is differentiated. Even the most experienced Python programmers can get caught up in a trap. The most common scenario is that the mix of tabs and spaces can cause errors, which cannot be separated by the naked eye.

3. Slow running: This is compared to C and C + +.

  

Application:

System Programming: Provides API (Application programming Interface application programming Interface), can facilitate system maintenance and management, Linux under one of the iconic languages, is the ideal programming tool for many system administrators [6].

Graphics Processing:With PiL, Tkinter and other graphics library support, can be easily graphics processing. Mathematical Processing:The numpy extension provides a large number of interfaces to many standard math libraries. Text Processing:The re modules provided by Python support regular expressions, as well as sgml,xml analysis modules, and many programmers use Python for the development of XML programs. Database programming: Programmers can communicate with Microsoft SQL Server,oracle,sybase,db2,mysql, SQLite, and other databases through modules that follow the Python DB-API (database application programming Interface) specification. Python comes with a gadfly module that provides a complete SQL environment. Network programming: Provides a wide range of modules to support sockets programming, enabling fast and easy development of distributed applications. Many large-scale software development programs such as Zope,mnet and BitTorrent. It is widely used by Google. Web Programming: The development language of the application, supporting the latest XML technology. Multimedia Applications:Python's Pyopengl module encapsulates the "OpenGL application Programming Interface" for two-and three-dimensional image processing. The Pygame module can be used to write game software. Pymo Engine:Pymo is all called Python memories off and is a AVG game engine running on Symbian S60v3,symbian3,s60v5, SYMBIAN3, and Android systems. It is named Pymo because it is developed based on the python2.0 platform and is applicable to the AVG game that creates the memory of autumn (memories off) style.

hacking Programming:python has a hack library with built-in functions that you are familiar with or unfamiliar with, but lack a sense of accomplishment.

  Standard library:

Python has a strong standard library. The core of the Python language contains only the common types and functions of numbers, strings, lists, dictionaries, files, and the Python standard library provides additional functions such as system management, network communication, text processing, database interfaces, graphics systems, XML processing, and so on.     The Python standard library has a clear naming interface, good documentation, and is easy to learn and use. The Python community provides a number of third-party modules that are used in a way similar to standard libraries. Their functions are all-encompassing, covering scientific computing, web development, database interfaces, graphics systems in many areas, and mostly mature and stable. Third-party modules can be written in Python or C language. Swig,sip is often used to convert a library written in C into a Python module. The Boost C + + libraries contains a set of libraries that are boost.python so that programs written in Python or C + + can invoke each other.     With a large number of tools based on the standard library, the ability to use low-level languages such as C and C++,python, which can be used as other library interfaces, has become a powerful glue language applied to other languages and tools. The main functions of the Python standard library are: Text processing, including text formatting, regular expression matching, text difference calculation and merging, Unicode support, binary data, file processing, including file operations, creation of temporary files, file compression and archiving, operation profiles and other functions, operating system functions, including thread and process support, IO multiplexing, date and time processing, call system functions, write journaling (logging) and other functions, network communications, including network sockets, SSL encrypted communications, asynchronous network communications and other functional network protocols, support HTTP,FTP,SMTP,POP,IMAP,NNTP , XMLRPC and other network protocols, and provides a framework for writing Web servers, the network format support, including html,sgml,xml processing. Other functions, including internationalization support, math, HASH, tkinter, etc.

What is Python?

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.