[Introduction to python tutorials] The 200 standard libraries of Python are classified and sorted for reference

Python has a useful set of standard libraries that are installed on your computer along with the Python interpreter. It is an integral part of Python and can be called directly without additional installation. These standard libraries are the tools that Python has prepared for you, which can make programming more efficient.

200 built-in standard libraries have been classified and arranged, which can be easily searched when needed in development.

text

string: generic string operations

re: regular expression operation

difflib: Difference calculation tool

textwrap: text padding

unicodedata: Unicode character database

stringprep: Internet String Preparation Tool

readline: GNU line-by-line read interface

rlcompleter: GNU implementation of line-by-line read

struct: parses bytes into packed binary data

codecs: Codecs for registry and base classes

type of data

datetime: based on date and time tools

calendar: Generic month function

collections: container data type

collections.abc: container virtual base class

heapq: heap queue algorithm

bisect: Array Bisection Algorithm

array: efficient numeric array

weakref: weak reference

types: Dynamic creation and naming of built-in types

copy: shallow copy and deep copy

reprlib: alternate repr() implementation

math

numbers: virtual base class for numbers

math: mathematical function

cmath: Mathematical function for complex numbers

decimal: Fixed-point and floating-point calculations

fractions: rational numbers

random: generate pseudo-random numbers

functional programming

itertools: Generate iterators for efficient loops

functools: Higher-order functions and operations on callable objects

operator: standard operations on functions

files and directories.

os.path: Generic pathname control

fileinput: iterate over lines from multiple input streams

stat: Interpret the result of stat()

filecmp: file and directory comparison function

tempfile: Generate temporary files and directories

glob: extension to Unix-style pathname format

fnmatch: Unix-style pathname format matching

linecache: random storage of text lines

shutil: advanced file operations

macpath: MacOS 9 path control functions

Endurance

pickle: Python object serialization

copyreg: the support function of the registration machine for pickle

shelve: Python object persistence

marshal: Internal Python object serialization

dbm: Unix "database" interface

sqlite3: API2.0 for SQLite database

compression

zlib: gzip-compatible compression

gzip: support for gzip files

bz2: support for bzip2 compression

lzma: Compression using the LZMA algorithm

zipfile: Manipulate ZIP archives

tarfile: read and write tar archive files

encryption

hashlib: secure hashing and message digests

hmac: key hash for message authentication

OS tools

os: multifaceted operating system interface

io: Stream core tool

time: query and conversion of time

argparser: a parser for command-line options, arguments, and subcommands

optparser: command line option parser

getopt: C-style command-line options parser

logging: Python logging tool

logging.config: logging configuration

logging.handlers: log handlers

getpass: Simple password input

curses: terminal handling of character display

curses.textpad: text input field for curses programs

curses.ascii: ASCII character set tool

curses.panel: control stack extension for curses

platform: access the underlying platform authentication data

errno: standard error token

ctypes: Python foreign function library

Concurrency

threading: thread-based parallelism

multiprocessing: process-based parallelism

concurrent: concurrent package

concurrent.futures: start parallel tasks

subprocess: subprocess management

sched: event scheduling

queue: synchronous queue

select: wait for I/O to complete

dummy_threading: Alternative to threading module (when _thread is not available)

_thread: The underlying thread API (threading is based on)

_dummy_thread: Alternative to _thread module (when _thread is not available)

interprocess communication

socket: the underlying network interface

ssl: TLS/SSL filler for socket objects

asyncore: asynchronous socket handler

asynchat: asynchronous socket command/response handler

signal: asynchronous transaction signal handler

mmap: memory mapped file support

the Internet

email: Mail and MIME processing package

json: JSON encoding and decoding

mailcap: mailcap file handling

mailbox: Control mailboxes in multiple formats

mimetypes: filename to MIME type mapping

base64: RFC3548: Base16, Base32, Base64 encoding

binhex: binhex4 file encoding and decoding

binascii: conversion between binary code and ASCII code

quopri: MIMEquoted - Encoding and decoding of printable data

uu: Encoding and decoding of uuencode files

Internet Protocol and Support

webbrowser: Simple Web Browser Controller

cgi: CGI support

cgitb: CGI script backtracking manager

wsgiref: WSGI tool and reference implementation

urllib: URL processing module

urllib.request: Extension library for opening URL connections

urllib.response: the response class of the urllib module

urllib.parse: Parse URLs into components

urllib.error: exception class raised by urllib.request

urllib.robotparser: Parser for robots.txt

http:HTTP模块

http.client: HTTP protocol client

ftplib: FTP protocol client

poplib: POP protocol client

imaplib: IMAP4 protocol client

nntplib: NNTP protocol client

smtplib: SMTP protocol client

smtpd: SMTP server

telnetlib: Telnet client

uuid: UUID object of RFC4122

socketserver: web server framework

http.server: HTTP server

http.cookies: HTTPCookie state manager

http.cookiejar: Cookie handling for HTTP clients

xmlrpc: XML - RPC server and client module

xmlrpc.client: XML - RPC client access

xmlrpc.server: XML - RPC server basics

ipaddress: IPv4/IPv6 control library

multimedia

audioop: process raw audio data

aifc: Read and write AIFF and AIFC files

sunau: Photograph Sun AU

wave: read and write WAV files

chunk: read IFF large files

colorsys: conversion between color systems

imghdr: Specifies the image type

sndhdr: Specifies the sound file type

ossaudiodev: Access OSS compatible audio devices

globalization

gettext: multilingual internationalization service

locale: internationalization service

programming framework

turtle: Turtle graphics library

cmd: line-based command interpreter support

shlex: Simple Lexicon Analysis

Tk Graphical User Interface

tkinter: Tcl/Tk interface

tkinter.ttk: Tk themed controls

tkinter.tix: Tk extension controls

tkinter.scrolledtext: scrolled text control

development tools

pydoc: documentation generator and online help system

doctest: Interactive Python Example

unittest: unit testing framework

unittest.mock: mock object library

test: Python regression testing package

test.support: Python test tool suite

venv: virtual environment setup

debugging

bdb: debugging framework

faulthandler: Python backtracking library

pdb: Python debugger

timeit: measure the execution time of a small piece of code

trace: Python execution state trace

Runtime

sys: system-related parameters and functions

sysconfig: Access Python configuration information

builtins: built-in objects

main: the top-level scripting environment

warnings: warning controls

contextlib: a context tool for the with state

abc: virtual base class

atexit: export handler

traceback: print or read a stack traceback

future: future state definition

gc: garbage collection interface

inspect: inspect live objects

site: address-related configuration hooks (hook)

fpectl: floating point exception control

distutils: Generate and install Python modules

interpreter

code: base class interpreter

codeop: Compile Python code

import module

imp: access to the internals of the import module

zipimport: import modules from ZIP archives

pkgutil: package extension tool

modulefinder: find modules by script

runpy: locate and execute Python modules

importlib: an implementation of import

Python language

parser: Access the Python parse tree

ast: abstract syntax tree

symtable: access compiler symbol table

symbol: constant in the Python parse tree

token: constant in the Python parse tree

keyword: Python keyword test

tokenize: Python source file tokenization

tabnany: fuzzy indent detection

pyclbr: Python class browsing support

py_compile: Compile Python source files

compileall: Compile Python libraries byte-by-byte

dis: Disassembler for Python bytecode

pickletools: Serialization Development Tools

other

formatter: Generic formatted output

Windows related

msilib: Read and write Windows Installer files

msvcrt: useful program for MS VC++ Runtime

winreg: Windows Registry Access

winsound: Windows sound playback interface

Unix related

posix: most commonly used POSIX calls

pwd: password database

spwd: shadow password database

grp: group database

crypt: Unix password authentication

termios: POSIX-style tty control

tty: terminal control function

pty: pseudo terminal tool

fcntl: system calls fcntl() and ioctl()

pipes: shell pipe interface

resource: resource availability information

nis: Sun's NIS interface

syslog: Unix logging service

The above is a brief summary of Python's built-in modules, which will be retrieved later when doing projects.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326827834&siteId=291194637