Python Common libraries

Source: Internet
Author: User

Usually will use some of the Python library, will not be updated regularly, is mainly used to do reverse library

The first is the installation of the Python library, first from the Internet to get the library's compressed package, decompression, usually put in the Python\lib directory

For example my own path C:\Python27\Lib, and then open a command prompt,

CD C:\Python27\Lib\chardet-2.3.0///here take Chardet library as an example

Python setup.py Install

Finally, import Chardet in the shell of Python to verify that it is installed

1.chardet Library

A library that examines the encoding method

Web page:>>>ImportUrllib>>> rawdata = Urllib.urlopen ('http://www.google.cn/'). Read ()>>>ImportChardet>>>Chardet.detect (rawdata) {'confidence': 0.98999999999999999,'encoding':'GB2312'}'} ' confidence means accurate probability 'Text:ImportCHARDETTT=open ('C:\\111.txt','RB') FF=tt.readline () enc=chardet.detect (FF)Printenc['encoding']tt.close ()

Small script:

>>> s='\xd7\xa2\xb2\xe1'>>>PrintS.decode ('ASCII','Ignore'), S.decode ('UTF8','Ignore'), S.decode ('GBK','Ignore'), S.decode ('gb2312','Ignore')

Online Inspection tool: http://www.mytju.com/classCode/tools/encode_gb2312.asp

2.numpy Library

A powerful matrix computing tool (it is said that NumPy Python translates into a free and more powerful MATLAB system!!!) At present, I use the solution of the equation of 22 yuan (is a little low ...). )

Use See me another essay: http://www.cnblogs.com/lomooo/p/5866747.html

Python Common libraries

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.