Python standard Library at a glance (Python advanced learning)

Source: Internet
Author: User
Tags base64 mathematical functions object serialization posix sqlite database syslog xml parser virtual environment

Transferred from: http://blog.csdn.net/jurbo/article/details/52334345

Write this cause is, or because in the Python challenge, sometimes want to solve problems, even should use which class library do not know, but also to Baidu (I do not believe that I am a person so embarrassed TVT)
It seems that since I learned the basics of Python syntax, I've seen some of the classic Python books and learned about some of the common library types. In the case of several grammar application proficiency, if you do not do the problem, like it can not significantly improve their knowledge reserves (so that you do Python challenge ah, nothing ~ ~).
Therefore, in order to avoid the Python challenge, even want to use the name of the class library is not aware of the embarrassing situation again.
I decided to translate the Python standard library, which is listed here. Do you want to check it soon?

the corresponding official source documents :

3.5.2 The Python standard Library
Https://docs.python.org/3.5/library/index.html

-Start my slag translation, please advise ~~-–

Python Standard Library

Although the Python language reference describes the exact syntax and semantics of the Python language, this library reference book describes the Python standard library. It also describes some of the optional components that are typically included in the Python release.

Python's standard library is very rich, as shown in the following list, which provides a lot of functionality. The library contains built-in modules (written in C) that provide access to the system's functionality, such as file I/O, and a Python module that provides a standardized solution for many problems that occur in daily programming. Some of these modules are explicitly designed to encourage and enhance the portability of the Python program by abstracting out the platform details to the platform-neutral Api.

The Python installer for the Windows platform typically includes the entire standard library, and also contains many additional components. For UNIX operating systems Python is typically provided as a collection of packages, so it may be necessary to use the wrapper tools provided with the operating system to obtain some or all of the optional components.

In addition to the standard library, there are thousands of growing components (from individual programs and module packages to the entire application development framework) that can be downloaded from the Python package index.

1. Introduction 2. Built-in function 3. Built-in constant 3.1 constant added site Module 4. Built-in Type 4.1. Truth Test 4.2. Boolean operation--and,or,not4.3. Comparison 4.4. Numeric type--int,float,complex4.5. iterator 4.6. Sequence--list,tuple,range4.7. Text sequence Type-- str4.8. Binary sequence type--bytes,bytearray,memoryview4.9. setting type--set,frozenset4.10. Mapping type--dict4.11.context Manager Types4.12.other built-in Types4.13. Special Properties 5. Built-in exception 5.1 base class 5.2 Specific Exception 5.3 Warning 5.4 exception hierarchy 6. Word Processing Service 6.1.string--common string Operations 6.2.re-- Regular expression Operations 6.3.difflib--help calculate incremental 6.4.textwrap--text wrapping and populating 6.5.unicodedata--unicode database 6.6.stringprep--Internet Strings 6.7.readline-- GNU ReadLine Interface 6.8.rlcompleter--for the GNU ReadLine function 7. Binary Data Service 7.1.struct--interpreting byte binary data 7.2.codecs-- Registry codec and base Class 8. Data type 8.1.datetime--basic date and Time type 8.2.calendar--calendar-related functions 8.3.collections-- Container data type 8.4.collections.abc--abstract base class container 8.5.heapq--heap queue algorithm 8.6.bisect--array binary algorithm 8.7.array--efficient numeric array 8.8.weakref--weak reference 8.9.types --Dynamic create type for built-in type and name 8.10.copy--shallow and deep copy operation 8.11.pprint--Print neat data 8.12.reprlib--alternate repr () implementation 8.13.enum-- Supports enumeration 9. Digital and mathematical modules 9.1.numbers--numeric abstract base class 9.2.math--mathematical functions 9.3.cmath--complex numbers mathematical functions 9.4.decimal--decimal point and floating point arithmetic 9.5.fractions-- Rational number 9.6.random--generating pseudo-random number 9.7.statistics--mathematical statistic function 10. Functional Programming Module 10.1.tertools--functions Create efficient loop iterators 10.2.functools--high-order functions and operations on callable objects 10.3.operator--standard operation functions 11. Access to files and directories 11.1.pathlib-- Object-oriented file system path 11.2.os.path--Common pathname operation 11.3.fileinput--traverse rows from multiple input stream 11.4. stat--Interpreting stat () results 11.5.filecmp--file and directory comparisons 11.6.tempfile--generate temporary files and directories 11.7.glob--unix style expansion path mode 11.8.fnmatch-- UNIX file name pattern matching 11.9.linecache--random-access Text line 11.10.shutil--Advanced file Operations 11.11macpath--mac OS 9 path operation function 12. Data Persistence 12.1.pickle-- Python object serialization 12.2.copyreg--Registration pickle support feature 12.3. Shelve--python object Persistence 12.4.marshal--Internal Python object serialization 12.5.dbm--interface Unix's "database" 12.6.sqlite3--2.0 DB API interface, For SQLite database 13. Data compression and archiving 13.1.zlib--compatible with gzip compression 13.2.gzip--support gzip file 13.3.bz2--support BZIP2 compression 13.4.lzma-- Using the LZMA compression algorithm 13.5.zipfile--operations Zip files 13.6.tarfile--Read and write tar files 14. file format 14.1.csv--csv file read and write 14.2.configparser-- Profile resolver 14.3.netrc--netrc file processing 14.4.xdrlib--encode and decode XDR data 14.5.plistlib--generate and resolve Mac OS X. plist files 15. Cryptographic Services 15.1.hashlib-- Secure hashing and message digest 15.2.hmac--message-based authentication 16. General operating system Services 16.1.os--various operating system interfaces 16.2.io--core processing flow tools 16.3.time--time access and conversion 16.4.argparse-- Parsing command-line options, parameters and sub-commands16.5.getopt command-line options--c-style parser 16.6.logging--python log tool 16.7.logging.config--Log Configuration 16.8.logging.handlers--log handler 16.9.getpass--portable password Input 16.10.curses-- Terminal Processing Unit character display 16.11.curses.textpad--text input widget 16.12.curses.ascii--common ASCII character 16.13.curses.panel--one panel stack extension 16.14.platform --access to the underlying platform's data 16.15.errno--standard errno system symbols 16.16.ctypes--foreign-to-Python function library 17. Concurrent Execution 17.1.threading-- Thread-based parallel 17.2.multiprocessing--process-based parallel 17.3.concurrent packet 17.4.concurrent.futures--initiates parallel task 17.5.subprocess--sub-process management 17.6. sched--Event Scheduler 17.7.queue--Synchronization Queue class 17.8.dummy_threading--threading module alternatives 17.9. _thread--replacement of the underlying thread Api17.10._dummy_thread--_thread module 18. interprocess Communication and networking 18.1. socket--the underlying network interface 18.2.ssl--tls/ssl socket object wrapper 18.3.select--waits for I/O completion 18.4. selectors--Advanced I/O multiplexing 18.5.asyncio--asynchronous I/O, Event loops, cooperative programs, and tasks 18.6.asyncore--asynchronous sockets handler 18.7. asynchat--Asynchronous Socket Command/response handler 18.8. signal--procedure for asynchronous event handling 18.9. mmap--support for memory-mapped files 19. Internet Data processing 19.1.email--e-mail and MIME processing package 19.2. Json--json encoding and decoder 19.3.mailcap--mailcap file processing 19.4. mailbox--Manipulate mailboxes 19.5.mimetypes--file names in various formats to MIME type 19.6.base64--base32, Base16 Base64, Base85 data encoding 19.7.binhex-- Encode and decode the binhex4 file 19.8.binascii--convert between binary and ASCII 19.9.quopri--Encoding and decoding of MIME quoted-printable data 19.10.uu--encoding and decoding of an encoded program file 20. Structured markup processing tool 20.1.html--support for Hypertext Markup Language 20.2. html.parser--Simple HTML and XHTML parser 20.3. XML api20.6.xml.dom--for html.entities--defined HTML entity 20.4.XML processing module 20.5.xml.etree.elementtree--elementtree Document Object Model api20.7.xml.dom.minidom--minimal DOM implementation 20.8.xml.dom.pulldom--support building part of the DOM tree 20.9.xml.sax-- Supports SAX2 parser 20.10.xml.sax.handler--base class Sax Handler 20.11.xml.sax.saxutils--sax Common class 20.12.xml.sax.xmlreader-- XML Parser Interface 20.13xml.parsers.expat--Fast use of expat XML parsing 21. Internet Protocol and Support 21.1.webbrowser--convenient browser controller 21.2.cgi-- The public gateway interface supports 21.3.cgitb--backtracking through CGI scripts 21.4.WSGIREF--WSGI tools and reference implementations 21.5.urllib--url processing modules 21.6.urllib.request-- Open the extensible library for the URL 21.7.urllib.response--the class used to respond to urllib 21.8.urllib.parse--resolves the url to a component 21.9.urllib.error-- Urllib.request the Exception class 21.10. Urllib.robotparser--robots. TXT interpreter 21.11.http--http Module 21.12.http.client--http Customer Agreement 21.13.FTPLIB--FTP Customer Agreement 21.14.POPLIB--POP3 Agreement customer 21.15. IMAPLIB--IMAP4 Customer Agreement 21.16.NNTPLIB--NNTP Customer Agreement 21.17.SMTPLIB--SMTP Customer Agreement 21.18.SMTPD--SMTP Server 21.19.telnetlib-- The Telnet client 21.20.uuid--the UUID object that is obtained according to RFC 4122 21.21. socketserver--network Server Framework 21.22.http.server--http Server 21.23.http.cookies--http State management 21.24.http.cookiejar-- COOKIES21.25.XMLRPC--XMLRPC Server and Client module 21.26.XMLRPC.CLIENT--XML-RPC Client Access 21.27.xmlrpc.server--Basic XML for HTTP clients- RPC Server 21.28.ipaddress--ipv4/ipv6 manipulation Library 22. Multimedia Services 22.1. audioop--manipulate raw audio data 22.2.aifc--read and write Aiff and aifc files 22.3.sunau--Read and write the Sun au file 22.4.wave--read and write WAV files 22.5.chunk-- Read IFF block data 22.6.colorsys--conversion between color systems 22.7.imghdr--determine the type of the image 22.8.sndhdr--determine the type of the sound file 22.9.ossaudiodev-- Access to oss-compatible Audio Devices 23. Internationalization 23.1.gettext--Multi-lingual International Service 23.2.locale--International Services 24. Program Framework 24.1.turtle--Turtle Drawing (a simple drawing tool) 24.2.cmd- -Support for line-oriented command interpreter 24.3.shlex--simple lexical analysis 25. TK's graphical user interface 25.1.tkinter--tcl/tk Python interface 25.2.tkinter.ttk--tk theme Widgets 25.3.tkinter.tix-- Extended TK Parts 25.4.tkinter.scrolledtext--scrolling text widget 25.6.idle25.7. Other graphical user interface Packages 26. Development tools 26.1.typing--Support type hints 26.2.pydoc-- Document builder and online Help system 26.3.doctest--test Interactive Python Sample 26.4.unittest--Unit Test Framework 26.5.unittest.mock--mock Object Library 26.6.unittest.mock-- Start 26.7.2to3--2 to 3 code translation 26.8.test--test package for Python regression 26.9.test.support--common python test suite 27. Debugging and Profiling 27.1.bdb-- Debugger Framework 27.2.faulthandler--the Python back 27.3.pdb--python debugger 27.4.Python parser 27.5. timeit--measures the execution time of a small code fragment 27.6.trace--trace or Python statement execution trace 27.7. tracemalloc--tracking Memory allocations 28. Software packaging and distribution 28.1.distutils--build and install Python modules 28.2.ensurepip--boot pip installer 28.3.venv-- Create a virtual environment 28.4.zipapp--manage Python executable zip archive 29. The Python Runtime service 29.1.sys--system-specific parameters and features 29.2.sysconfig--provides Python configuration information 29.3.builtins--built-in object 29.4. _main--Top scripting Environment 29.5.warnings--alert Control 29.6.contextlib--Common with-statement Context 29.7.abc--abstract base class 29.8.atexit-- Exit handler 29.9.traceback--Print or retrieve a stack backtracking 29.10. Future--future declarations define the 29.11.gc--garbage collector interface 29.12.inspect--Check the active object 29.13.site--a specific site configuration hook 29.14.fpectl-- Floating-point exception control 30. Custom Python interpreter 30.1.code--translation base class 30.2. codeop--compiling Python Code 31. Import Module 31.1.zipimport--Import module from ZIP document 31.2.pkgutil--Package Extension tool 31.3.modulefinder--find script used by module 31.4.runpy-- Locate and execute the Python module 31.5.importlib--import implementation 32. Python language service 32.1.parser--access Python parse tree 32.2.ast--abstract Syntax tree 32.3.symtable--access compiler symbol table 32.4.symbol--constants using Python parse tree 32.5.token- -Constants Use the Python parse tree 32.6.keyword--python test keyword 32.7.tokenize--the python source code compiler 32.8.tabnanny--detect ambiguous indentation 32.9.pyclbr-- Python class browser supports 32.10.py_compile--compiling python source files 32.11.compileall--byte-compile Python library 32.12.dis-- Disassembler python bytecode 32.13.pickletools--kimchi developer Tools 33. Various services 33.1.formatter--Universal output format 34.MS Windows-specific service 34.1. msilib--Read and write Microsoft Installer files 34.2.msvcrt--ms VC + + Runtime useful program 34.3 Winreg--windows registry access 34.4.winsound--Sound playback interface Windows 35. UNIX-specific Services 35.1.posix--most common POSIX system calls 35.2.pwd--password database 35.3spwd--Shadow password database 35.4.grp--Group database 35.5crypt--function check UNIX password 35.6 Termios--posix style remote control 35.7. tty--Terminal control function 35.8. pty--Pseudo Terminal tool 35.9 FCNTL--FCNTL and IOCTL system call 35.10. pipes--Interface Shell Pipe 35.11.resource--Resource usage information 35.12. Nis--sun's NIS (Yellow Pages) interface 35.13.syslog--unix syslog Library process 36. Replace the command-line options for the module 36.1.optparse--parser 36.2.imp--Access Import internal 37. Illegal modules 37.1. Platform-specific modules

Python standard Library at a glance (Python advanced learning)

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.