"Forwarding" article read Python's main application areas or scenarios

Source: Internet
Author: User

Forwarding Source: http://www.elecfans.com/d/644370.html

About Python

Python (United Kingdom pronunciation:/?pa?θ?n/American pronunciation:/?pa?θɑ?n/) is an object-oriented, interpreted computer programming language, invented by the Dutch Guidovanrossum in 1989, and the first public offering was released in 1991.

Python is purely free software, and the source code and interpreter CPython follow the GPL (gnugeneralpubliclicense) protocol. Python syntax is simple and clear, one of the features is to force the use of whitespace (whitespace) as a statement indentation.

Python has a rich and powerful library. It is often nicknamed the glue language and is able to easily connect a variety of modules made in other languages, especially in C + +. A common application scenario is to use Python to quickly build a prototype of a program (sometimes even the final interface of the program) and then rewrite it in a more appropriate language, such as a graphics rendering module in a 3D game, with a particularly high performance requirement, and can be rewritten in C + + with a specially requested part. It is then encapsulated as an extension class library that Python can call. It is important to note that you may need to consider platform issues when you use the Extended class library, and some may not provide cross-platform implementations.

python features

1, Python uses C language development, but Python no longer has a C language pointers and other complex data types.

2, Python has a very strong object-oriented characteristics, but also simplifies the object-oriented implementation. It eliminates object-oriented elements such as protection types, abstract classes, interfaces, and so on.

3. The Python code block separates the code using a space or tab indent.

4, Python has only 31 reserved words, and there is no semicolon, begin, end and other tags.

5, Python is a strongly typed language, variable creation will correspond to a data type, the different types of variables appearing in the unified expression need to do type conversion.

python builds development environment

1, you can download the installation package to www.python.org, and then through configure, make, Makeinstall to install.

2, you can also go to www.activestate.com to download the ActivePython component package. (ActivePython is a binary wrapper for the Python core and common modules, which is a Python development environment published by ActiveState Company.) ActivePython makes Python installation easier and can be applied on a variety of operating systems. ActivePython contains some common Python extensions, as well as programming interfaces for the Windows environment. For ActivePython, if you are a Windows user, download the MSI package installation, and if you are a UNIX user, download the tar.gz package and unzip it directly.

3, Python IDE, including Pythonwin, Eclipse+pydev plug-ins, Komodo, EditPlus.

Application of Python

System Programming: Provide API (Applicationprogramminginterface application programming Interface), can facilitate system maintenance and management, Linux under one of the iconic language, is the ideal programming tool for many system administrators.

Graphics processing: 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 module provided by Python supports regular expressions, and it also provides sgml,xml analysis modules, and many programmers use Python for the development of XML programs.

Database programming: Programmers can communicate with Microsoftsqlserver,oracle,sybase,db2,mysql, SQLite and other databases by following the PYTHONDB-API (database application programming Interface) specification module. 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.google, are widely used.

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, all called Pythonmemoriesoff, is a AVG game engine running on a symbians60v3,symbian3,s60v5,symbian3,android system. It is named Pymo because it is developed based on the python2.0 platform and is suitable for creating the AVG Game of Autumn Memories (Memoriesoff) 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.

Write a simple crawler in Python

Through the above three sentences can be the source code of the URL exists in the content variable, its type is character type.

The next step is to extract the content we need from this stack of HTML sources. Use Chrome to see the code for the corresponding content (you can also use Firefox's Firebug).

You can see that the information for the URL is stored in the span tag, and the information you want to get it can be used in regular style.

Python application Scenarios

Web application Development

Python is often used for web development. For example, with the Mod_wsgi module, Apache can run web programs written in Python. Python defines the WSGI standard application interface to coordinate the communication between the HTTP server and the Python-based Web program. Some web frameworks, such as django,turbogears,web2py,zope, can make it easy for programmers to develop and manage complex web programs.

Operating System Management, server operations Automation scripts

In many operating systems, Python is the standard system component. Most Linux distributions, as well as NetBSD, OpenBSD, and MacOSX, are integrated with Python and can be run directly under the terminal. Some installers for Linux distributions are written in the Python language, such as the Ubuntu ubiquity Installer, Redhatlinux and Fedora Anaconda installers. Gentoolinux uses Python to write its Portage package management system. The Python standard library contains multiple libraries that invoke operating system functionality. By Pywin32 This third-party package, Python has access to Windows COM services and other windowsapi. Use the Ironpython,python program to directly invoke the. NETFramework. In general, the system management scripts written by Python are superior to normal shell scripts in terms of readability, performance, code reuse, and extensibility.

Scientific calculations

Numpy,scipy,matplotlib allows Python programmers to write scientific computing programs.

Desktop software

PyQt, Pyside, WxPython, and PYGTK are a powerful tool for Python to rapidly develop desktop applications.

Server Software (network software)

Python's support for various network protocols is perfect, so it is often used to write server software and web crawlers. The third-party library twisted supports asynchronous network programming and most standard network protocols (including clients and servers), and provides a variety of tools that are widely used to write high-performance server software.

Game

Many games use C + + to write high-performance modules such as graphical display, while using Python or Lua to write game logic, servers. Compared to Python,lua, the functionality is simpler and smaller, while Python supports more features and data types.

Concept implementation, early prototyping and iteration of the product

YouTube, Google, Yahoo! , NASA uses Python extensively in its own way.

application direction of Python

1. General Software Development

Python supports functional programming and OOP object-oriented programming, and can assume the development of any kind of software, so routine software development, scripting, and network programming are standard capabilities.

2. Scientific calculations

With the development of many libraries such as Numpy,scipy,matplotlib,enthoughtlibrarys, Python is becoming more and more suitable for scientific computing and high-quality 2D and 3D images. Compared with the most popular business software matlab in the field of scientific computing, Python is a universal programming language that is more widely used than the scripting language used by MATLAB and has more support for libraries. While many of the advanced features and toolbox in MATLAB are still irreplaceable, there is still a lot of work to do with Python in everyday research and development.

3. Automated operation and Maintenance

This is almost the private plots of Python applications, and as the preferred programming language for operations engineers, Python has been deeply rooted in automating operations, such as Saltstack and Ansible, which are well-established automation platforms.

4. Cloud Computing

The open source cloud computing solution OpenStack is based on the development of Python, the cloud computing students understand.

5.WEB Development

Python-based Web development framework not too many, such as the familiar Django, and Tornado,flask. The Python+django architecture, with its wide application range, very fast development and low learning thresholds, can help you quickly build available Web services.

6. Web crawler

Also known as Web spiders, the big data industry is the core tool for data acquisition. No web crawler automatically, day and night, high intelligence to crawl free data on the Internet, those big data-related companies are probably three-fourths less. There are many programming languages that can write web crawlers, but Python is definitely one of the mainstream, and its scripy crawler framework is widely used.

7. Data analysis

On the basis of a large amount of data, combined with scientific computing, machine learning and other technologies, data cleaning, deduplication, normalization and targeted analysis is the cornerstone of the big data industry. Python is one of the mainstream languages of data analysis.

8. Artificial Intelligence

Python in the field of artificial intelligence, machine learning, neural networks, deep learning and other aspects are the mainstream programming language, has been widely supported and applied.

"Forwarding" article read Python's main application areas or scenarios

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.