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