Python class common

Source: Internet
Author: User

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 [5] .

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 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.

Write a simple crawler in Python

First of all, to get the corresponding HTML source code by URLLIB2 this module.

1234 import urllib2  #调用urllib2  url=‘http://www.baidu.com/s?wd=cloga‘#把等号右边的网址赋值给urlhtml=urllib2.urlopen(url).read()   #html随意取名 等号后面的动作是打开源代码页面,并阅读printhtml #打印

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 class common

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.