Douban's development language: the all-powerful python

大家讲道理
Release: 2016-11-07 17:47:01
Original
1597 people have browsed it

Facing the dazzling light of Pearl (Perl), the Spirit Snake (Python) has the ability to reach heaven and earth. It can run on MS-DOS, Amiga, BeOS, OS/2, VMS, QNX and other OS; it is faster and better than Perl and VB, and more scalable than C and C++ languages; not only in "Star Wars" , "Star Trek" and other super blockbuster stunts and animation production, and also broke into the NASA control room. For the truth, please read the report.

 For the Perl (Pearl) language, it can be said that everyone on the Internet knows and understands it; it runs quickly, is easy to operate, and allows users to have endless fun when using it. But it also has its downsides: its openness also brings with it complexity, which can be especially confusing when using it to handle large projects.

Despite this, most Internet projects still rely on Perl as the "hero" to build.

 But there is no choice. The latest recommended software is called Python (Spirit Snake). Its history is only 1/4 of Perl and has many similar features.

 Python’s name comes from the famous comedy troupe Monty Python, which has many well-known actors and created many well-known screen images. So, what is the image of Python in the Internet world?

  Faster and better Python

Like Perl, Python is also an interpreted language. It completely adopts an object-oriented approach, and the language structure is between the C language and the Perl language. Although it is regarded as an advanced language, its built-in interpreter is very basic, with only a few functions, operators, and keywords making up the entire programming language. Its advantages don't end there, it can be expanded through a series of modules. It is both faster and better than Perl and VB statements, and more extensible than C and C++ languages.

 Similarly, Python’s processing of program statements is first converted into a series of byte codes through an interpretation and compilation system, and then processed by Python’s virtual machine. Python is designed very efficiently, mainly due to its huge function library, so users do not need to enter the system environment or operating system, nor do they need to reference modules. Programming in Python, small programs are still small programs, without incurring too much cost and time.

 In addition to its Core platform, Python can also run on MS-DOS, Amiga, BeOS, OS/2, VMS, QNX and many other operating systems. You can even run Python programs on your handheld computer. Facing the dazzling light of Pearl (Perl), the Spirit Snake (Python) has the ability to reach heaven and earth.

 In addition to its Core platform, Python can also run on MS-DOS, Amiga, BeOS, OS/2, VMS, QNX and many other operating systems. You can even run Python programs on your handheld computer.

 Python also has the following significant features:

 Super adaptability

 Python can be supported by a series of platforms. Its well-compiled format runs on Windows and MacOS and its own Tk extension platform, and can be used to develop user-friendly interfaces. On UNIX and other platforms, Python can be compiled as source code by programmers or used with other pre-written binary codes. Its super adaptability makes it cross-platform applicable: 95% of the program segments written on the UNIX platform can be used on Mac and PC without any modification. Expanding the Tk platform's support for it can even allow applications based on GUI format to switch freely between the above three platforms without any major effort, while maintaining a unified interface.

 Because of this natural cross-platform running capability, Python can also support expansion platforms for some platforms, thus simplifying and eliminating the adaptation process to other languages ​​and environments. Just as the SunOS/Solaris tools come with Sun audio devices and the SGI version comes with audio and video interfaces (including OpenGL), the Windows Pytyon interpreter also comes with the Visual C++ class library and Windows audio driver interface. There are also functions for communicating with COM objects.

 Super functionality

 Python can do almost anything. Its core is small, but it has enough basic program blocks to design most application software. And in some cases, the programming language can be extended and used with C, C++ and Java languages, so there is no program that it cannot write. The Python interpreter also comes with an extremely powerful library of supplementary modules that extend the language's capabilities for network communication, text processing, and regular expression matching.

Although Python’s main feature is to hide many low-level complex tasks from programmers, it can also support hooks, extensions, and other functions for low-level access to certain operating systems. Because of this characteristic of both high and low, Python can be regarded as a language of the same level as C, Visual Basic, or other level languages ​​in between.

Extraordinary scalability

 Because Python itself is written in C language (some expansion platforms are written in C++ language), and it uses open source code, the program itself can be actively expanded. In addition, many modules of the programming language are supported by C and C++ interfaces, including some basic components such as network and DBM database access, as well as many other advanced tools such as Tk.

 In addition, Python can be integrated into the C or C++ language, so that the Python language can be used to provide a programming interface for applications. Based on its cross-language development support capabilities, you can also use Python to design applications and then transfer them to the C language environment without having to rewrite the program in C language, because both languages ​​​​can be used at the same time.

  JPython is a Python interpreter written entirely in Java language, which means that any Python program can be connected to a Java object or an application that uses Python objects.

 Superior simplicity

 After understanding the above basic features of Python, it is relatively easy to understand the content of the programming language. The language core is small and the format and style are concise. Since all other components and extensions use the exact same syntax, programming in Python becomes fast.

 But this does not mean that the Python language is not complex. Its many extensions and libraries must be carefully considered before they can be used effectively.

 Super functionality

With such extensive support and the ability to learn from others’ strengths, Python is particularly effective in dealing with a range of problems. The following is a brief introduction to its functions: Calculator: An extension program supported by Python is called NumPy, which can provide interfaces to many standard mathematics libraries. The Python language also has infinite precision and can handle arithmetic of 100-digit numbers alone.

 Word Processor:

 

 Python can split, accumulate and summarize any data. Its module can split the elements in the log file line, record and summarize the information according to the built-in data types, and finally output it. Its regular expression library enables programmers to use emacs, Perl, and more. This once again proves the omnipotence of Python. Some programmers once used Python to compile very complex SGML processing tools.

Convenient application development:

Python is clear to programmers, and programming with it is quick and effective. Its extensive module library provides interfaces to different protocols, tools and libraries. Avoid the pain of redevelopment.

Since Python also supports the Tk tool, an application software can be completed in a few hours, while it may take 2 to 3 days with Perl language, and even several weeks with C language.

 Cross-platform development:

 Python supports a range of different platforms in a neutral way. If the system used by the user contains different platforms, it is best to use Python to develop applications; its adaptability can also be reserved for the system Possibility of using other tools. For users who frequently switch platforms, Python is an ideal choice.

 When providing software services to end users, Python is also an alternative, which can avoid the time and expense of programming with different application software at the same time.

 System Devices

 Python is designed to avoid the nuisance of low-level parts of the operating system, but if you need to actively enter these low-level parts, you can do so through corresponding tools and extensions. Python has access to the same capabilities as the operating system, and can be backed up and extended, and the backed up and extended features add to all of Python's adaptability and interface capabilities.

 Internet Programming

 Python comes with standard modules that can perform basic and protocol-level communication on network slots. For example, if you want to read emails from a POP server, the library modules that come with Python can do it. In addition, Python also supports XML, HTML and CGI library files, so you can use it to parse user input requirements and produce the best quality results through the web server.

 Programmers can also compile modules for Apache, Unix and Windows web servers that have Python’s built-in interpreter. Based on the power of CGI programs, Python statements can be easily executed without loading them separately.

  Database Programming

  There are countless expansion modules in Python that can connect to common database systems such as Orcle, Informix, mySOL and PostgreSql; there is also a tool called Gadfly that can provide a complete SQL environment independently of Python. Python has powerful text and data processing capabilities. You can use it as a connection between different databases, which is more advantageous than the summary and reporting tools that come with those databases. At the same time, because it supports different systems, you can connect to any database using the same interface. You can use Tk to build a front-end on the supported platform, and you will immediately have high-speed cross-platform, independent database query tools.

  Others

 Python has a wide range of applications, and there are almost no languages ​​that it is not suitable for. With its tiny kernel, rich functions, and diverse data, Python provides a good foundation for program construction. Combining the advantages of C and C++, Python programs can be infinitely expanded as long as appropriate structures and methods are adopted. In addition to a host of significant advantages, Python also has disadvantages.

 It’s really not easy to list the shortcomings of Python. Python provides most of its functionality in its extension modules and demonstrates how easy it is to add functionality. Once it doesn't solve the problem, you only need to rewrite an extension program in C or C++.

People who criticize Python often do not say that Python lacks a certain function, but that they do not understand this function. There is also a common complaint that Python lacks support for regular expressions - but there are actually two modules that can be used to handle regular expressions, one of which can also be used to fully support the sentence syntax of the Perl language. The handling of regular expressions is not baked into the language, but that doesn't mean it can't be done.

  Compared to Perl, Rebol and Java statements, the advantage of Python is that its kernel is small. This reduces execution time because less code needs to be loaded at runtime, and this feature also makes it more adaptable.

 Once you are familiar with the concise style of Python statements, its powerful advantages will immediately become apparent. Programs written with it last forever.

 Python’s ideal user group

 It is suitable for different types of users to solve different types of problems. Most of the time these issues are generally unknown because of their high level of confidentiality. There are also large companies that use it for commercial development and demonstrate the results of development.

  Red Hat has used Python and Tk to successfully develop a visual interface for configuring and managing the operating system. The entire system can fully control the Linux operating system and automatically update configuration files according to user selections.

 Infoseek uses Python in its public search engine. The company also customized its software using Python to allow end users to easily download content from the site.

  NASA also uses the Python programming language in many fields. The most famous one is the use of Python for mission planning in the mission control center; the use of Python in other aspects such as calculating the orientation of celestial bodies and designing satellites The path, etc. fully reflect the super computing power of Python.

An industry that plays a leading role in stunt and animation production in super blockbusters such as "Planet Station", "Abyss", "Star Trek", and "Indiana Jones" Industrial Light also uses Python to produce commercial animations.


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template