Python Module Index

_ | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | z
_
__future__Future statement definitions未来声明定义
__main__The environment where top-level code is run. Covers command-line interfaces, import-time behavior, and ``__name__ == '__main__'``.
_threadLow-level threading API.
a
abcAbstract base classes according to :pep:`3119`.
aifcDeprecated:Read and write audio files in AIFF or AIFC format.
argparseCommand-line option and argument parsing library.
arraySpace efficient arrays of uniformly typed numeric values.
astAbstract Syntax Tree classes and manipulation.
asynchatDeprecated:Support for asynchronous command/response protocols.
asyncioAsynchronous I/O.
asyncoreDeprecated:A base class for developing asynchronous socket handling services.
atexitRegister and execute cleanup functions.
audioopDeprecated:Manipulate raw audio data.
b
base64RFC 4648: Base16, Base32, Base64 Data Encodings; Base85 and Ascii85
bdbDebugger framework.
binasciiTools for converting between binary and various ASCII-encoded binary representations.
binhexEncode and decode files in binhex4 format.
bisectArray bisection algorithms for binary searching.
builtinsThe module that provides the built-in namespace.
bz2Interfaces for bzip2 compression and decompression.
c
calendarFunctions for working with calendars, including some emulation of the Unix cal program.
cgiDeprecated:Helpers for running Python scripts via the Common Gateway Interface.
cgitbDeprecated:Configurable traceback handler for CGI scripts.
chunkDeprecated:Module to read IFF chunks.
cmathMathematical functions for complex numbers.
cmdBuild line-oriented command interpreters.
codeFacilities to implement read-eval-print loops.
codecsEncode and decode data and streams.
codeopCompile (possibly incomplete) Python code.
collectionsContainer datatypes
collections.abcAbstract base classes for containers
colorsysConversion functions between RGB and other color systems.
compileallTools for byte-compiling all Python source files in a directory tree.
concurrent
concurrent.futuresExecute computations concurrently using threads or processes.
configparserConfiguration file parser.
contextlibUtilities for with-statement contexts.
contextvarsContext Variables
copyShallow and deep copy operations.
copyregRegister pickle support functions.
cProfile
crypt(Unix)Deprecated:The crypt() function used to check Unix passwords.
csvWrite and read tabular data to and from delimited files.
ctypesA foreign function library for Python.
curses(Unix)An interface to the curses library, providing portable terminal handling.
curses.asciiConstants and set-membership functions for ASCII characters.
curses.panelA panel stack extension that adds depth to curses windows.
curses.textpadEmacs-like input editing in a curses window.
d
dataclassesGenerate special methods on user-defined classes.
datetimeBasic date and time types.
dbmInterfaces to various Unix "database" formats.
dbm.dumbPortable implementation of the simple DBM interface.
dbm.gnu(Unix)GNU's reinterpretation of dbm.
dbm.ndbm(Unix)The standard "database" interface, based on ndbm.
decimalImplementation of the General Decimal Arithmetic Specification.
difflibHelpers for computing differences between objects.
disDisassembler for Python bytecode.
distutilsSupport for building and installing Python modules into an existing Python installation.
distutils.archive_utilUtility functions for creating archive files (tarballs, zip files, ...)
distutils.bcppcompiler
distutils.ccompilerAbstract CCompiler class
distutils.cmdProvides the abstract base class :class:`~distutils.cmd.Command`. This class is subclassed by the modules in the distutils.command subpackage.
distutils.commandContains one module for each standard Distutils command.
distutils.command.bdistBuild a binary installer for a package
distutils.command.bdist_dumbBuild a "dumb" installer - a simple archive of files
distutils.command.bdist_msiBuild a binary distribution as a Windows MSI file
distutils.command.bdist_packagerAbstract base class for packagers
distutils.command.bdist_rpmBuild a binary distribution as a Redhat RPM and SRPM
distutils.command.buildBuild all files of a package
distutils.command.build_clibBuild any C libraries in a package
distutils.command.build_extBuild any extensions in a package
distutils.command.build_pyBuild the .py/.pyc files of a package
distutils.command.build_scriptsBuild the scripts of a package
distutils.command.checkCheck the meta-data of a package
distutils.command.cleanClean a package build area
distutils.command.configPerform package configuration
distutils.command.installInstall a package
distutils.command.install_dataInstall data files from a package
distutils.command.install_headersInstall C/C++ header files from a package
distutils.command.install_libInstall library files from a package
distutils.command.install_scriptsInstall script files from a package
distutils.command.registerRegister a module with the Python Package Index
distutils.command.sdistBuild a source distribution
distutils.coreThe core Distutils functionality
distutils.cygwinccompiler
distutils.debugProvides the debug flag for distutils
distutils.dep_utilUtility functions for simple dependency checking
distutils.dir_utilUtility functions for operating on directories and directory trees
distutils.distProvides the Distribution class, which represents the module distribution being built/installed/distributed
distutils.errorsProvides standard distutils exceptions
distutils.extensionProvides the Extension class, used to describe C/C++ extension modules in setup scripts
distutils.fancy_getoptAdditional getopt functionality
distutils.file_utilUtility functions for operating on single files
distutils.filelistThe FileList class, used for poking about the file system and building lists of files.
distutils.logA simple logging mechanism, :pep:`282`-style
distutils.msvccompilerMicrosoft Compiler
distutils.spawnProvides the spawn() function
distutils.sysconfigLow-level access to configuration information of the Python interpreter.
distutils.text_fileProvides the TextFile class, a simple interface to text files
distutils.unixccompilerUNIX C Compiler
distutils.utilMiscellaneous other utility functions
distutils.versionImplements classes that represent module version numbers.
doctestTest pieces of code within docstrings.
e
emailPackage supporting the parsing, manipulating, and generating email messages.
email.charsetCharacter Sets
email.contentmanagerStoring and Retrieving Content from MIME Parts
email.encodersEncoders for email message payloads.
email.errorsThe exception classes used by the email package.
email.generatorGenerate flat text email messages from a message structure.
email.headerRepresenting non-ASCII headers
email.headerregistryAutomatic Parsing of headers based on the field name
email.iteratorsIterate over a message object tree.
email.messageThe base class representing email messages.
email.mimeBuild MIME messages.
email.parserParse flat text email messages to produce a message object structure.
email.policyControlling the parsing and generating of messages
email.utilsMiscellaneous email package utilities.
encodings
encodings.idnaInternationalized Domain Names implementation
encodings.mbcsWindows ANSI codepage
encodings.utf_8_sigUTF-8 codec with BOM signature
ensurepipBootstrapping the "pip" installer into an existing Python installation or virtual environment.
enumImplementation of an enumeration class.
errnoStandard errno system symbols.
f
faulthandlerDump the Python traceback.
fcntl(Unix)The fcntl() and ioctl() system calls.
filecmpCompare files efficiently.
fileinputLoop over standard input or a list of files.
fnmatchUnix shell style filename pattern matching.
fractionsRational numbers.
ftplibFTP protocol client (requires sockets).
functoolsHigher-order functions and operations on callable objects.
g
gcInterface to the cycle-detecting garbage collector.
getoptPortable parser for command line options; support both short and long option names.
getpassPortable reading of passwords and retrieval of the userid.
gettextMultilingual internationalization services.
globUnix shell style pathname pattern expansion.
graphlibFunctionality to operate with graph-like structures
grp(Unix)The group database (getgrnam() and friends).
gzipInterfaces for gzip compression and decompression using file objects.
h
hashlibSecure hash and message digest algorithms.
heapqHeap queue algorithm (a.k.a. priority queue).
hmacKeyed-Hashing for Message Authentication (HMAC) implementation
htmlHelpers for manipulating HTML.
html.entitiesDefinitions of HTML general entities.
html.parserA simple parser that can handle HTML and XHTML.
httpHTTP status codes and messages
http.clientHTTP and HTTPS protocol client (requires sockets).
http.cookiejarClasses for automatic handling of HTTP cookies.
http.cookiesSupport for HTTP state management (cookies).
http.serverHTTP server and request handlers.
i
imaplibIMAP4 protocol client (requires sockets).
imghdrDeprecated:Determine the type of image contained in a file or byte stream.
impDeprecated:Access the implementation of the import statement.
importlibThe implementation of the import machinery.
importlib.abcAbstract base classes related to import
importlib.machineryImporters and path hooks
importlib.metadataThe implementation of the importlib metadata.
importlib.resourcesPackage resource reading, opening, and access
importlib.utilUtility code for importers
inspectExtract information and source code from live objects.
ioCore tools for working with streams.
ipaddressIPv4/IPv6 manipulation library.
itertoolsFunctions creating iterators for efficient looping.
j
jsonEncode and decode the JSON format.
json.toolA command line to validate and pretty-print JSON.
k
keywordTest whether a string is a keyword in Python.
l
lib2to3The 2to3 library
linecacheProvides random access to individual lines from text files.
localeInternationalization services.
loggingFlexible event logging system for applications.
logging.configConfiguration of the logging module.
logging.handlersHandlers for the logging module.
lzmaA Python wrapper for the liblzma compression library.
m
mailboxManipulate mailboxes in various formats
mailcapMailcap file handling.
marshalConvert Python objects to streams of bytes and back (with different constraints).
mathMathematical functions (sin() etc.).
mimetypesMapping of filename extensions to MIME types.
mmapInterface to memory-mapped files for Unix and Windows.
modulefinderFind modules used by a script.
msilib(Windows)Deprecated:Creation of Microsoft Installer files, and CAB files.
msvcrt(Windows)Miscellaneous useful routines from the MS VC++ runtime.
multiprocessingProcess-based parallelism.
multiprocessing.connectionAPI for dealing with sockets.
multiprocessing.dummyDumb wrapper around threading.
multiprocessing.managersShare data between process with shared objects.
multiprocessing.poolCreate pools of processes.
multiprocessing.shared_memoryProvides shared memory for direct access across processes.
multiprocessing.sharedctypesAllocate ctypes objects from shared memory.
n
netrcLoading of .netrc files.
nis(Unix)Deprecated:Interface to Sun's NIS (Yellow Pages) library.
nntplibDeprecated:NNTP protocol client (requires sockets).
numbersNumeric abstract base classes (Complex, Real, Integral, etc.).
o
operatorFunctions corresponding to the standard operators.
optparseDeprecated:Command-line option parsing library.
osMiscellaneous operating system interfaces.
os.pathOperations on pathnames.
ossaudiodev(Linux, FreeBSD)Deprecated:Access to OSS-compatible audio devices.
p
pathlibObject-oriented filesystem paths
pdbThe Python debugger for interactive interpreters.
pickleConvert Python objects to streams of bytes and back.
pickletoolsContains extensive comments about the pickle protocols and pickle-machine opcodes, as well as some useful functions.
pipes(Unix)Deprecated:A Python interface to Unix shell pipelines.
pkgutilUtilities for the import system.
platformRetrieves as much platform identifying data as possible.
plistlibGenerate and parse Apple plist files.
poplibPOP3 protocol client (requires sockets).
posix(Unix)The most common POSIX system calls (normally used via module os).
pprintData pretty printer.
profilePython source profiler.
pstatsStatistics object for use with the profiler.
pty(Unix)Pseudo-Terminal Handling for Unix.
pwd(Unix)The password database (getpwnam() and friends).
py_compileGenerate byte-code files from Python source files.
pyclbrSupports information extraction for a Python module browser.
pydocDocumentation generator and online help system.
q
queueA synchronized queue class.
quopriEncode and decode files using the MIME quoted-printable encoding.
r
randomGenerate pseudo-random numbers with various common distributions.
reRegular expression operations.
readline(Unix)GNU readline support for Python.
reprlibAlternate repr() implementation with size limits.
resource(Unix)An interface to provide resource usage information on the current process.
rlcompleterPython identifier completion, suitable for the GNU readline library.
runpyLocate and run Python modules without importing them first.
s
schedGeneral purpose event scheduler.
secretsGenerate secure random numbers for managing secrets.
selectWait for I/O completion on multiple streams.
selectorsHigh-level I/O multiplexing.
shelvePython object persistence.
shlexSimple lexical analysis for Unix shell-like languages.
shutilHigh-level file operations, including copying.
signalSet handlers for asynchronous events.
siteModule responsible for site-specific configuration.
smtpdDeprecated:A SMTP server implementation in Python.
smtplibSMTP protocol client (requires sockets).
sndhdrDeprecated:Determine type of a sound file.
socketLow-level networking interface.
socketserverA framework for network servers.
spwd(Unix)Deprecated:The shadow password database (getspnam() and friends).
sqlite3A DB-API 2.0 implementation using SQLite 3.x.
sslTLS/SSL wrapper for socket objects
statUtilities for interpreting the results of os.stat(), os.lstat() and os.fstat().
statisticsMathematical statistics functions
stringCommon string operations.
stringprepString preparation, as per RFC 3453
structInterpret bytes as packed binary data.
subprocessSubprocess management.
sunauDeprecated:Provide an interface to the Sun AU sound format.
symtableInterface to the compiler's internal symbol tables.
sysAccess system-specific parameters and functions.
sysconfigPython's configuration information
syslog(Unix)An interface to the Unix syslog library routines.
t
tabnannyTool for detecting white space related problems in Python source files in a directory tree.
tarfileRead and write tar-format archive files.
telnetlibDeprecated:Telnet client class.
tempfileGenerate temporary files and directories.
termios(Unix)POSIX style tty control.
testRegression tests package containing the testing suite for Python.
test.supportSupport for Python's regression test suite.
test.support.bytecode_helperSupport tools for testing correct bytecode generation.
test.support.import_helperSupport for import tests.
test.support.os_helperSupport for os tests.
test.support.script_helperSupport for Python's script execution tests.
test.support.socket_helperSupport for socket tests.
test.support.threading_helperSupport for threading tests.
test.support.warnings_helperSupport for warnings tests.
textwrapText wrapping and filling
threadingThread-based parallelism.
timeTime access and conversions.
timeitMeasure the execution time of small code snippets.
tkinterInterface to Tcl/Tk for graphical user interfaces
tkinter.colorchooser(Tk)Color choosing dialog
tkinter.commondialog(Tk)Tkinter base class for dialogs
tkinter.dnd(Tk)Tkinter drag-and-drop interface
tkinter.filedialog(Tk)Dialog classes for file selection
tkinter.font(Tk)Tkinter font-wrapping class
tkinter.messagebox(Tk)Various types of alert dialogs
tkinter.scrolledtext(Tk)Text widget with a vertical scroll bar.
tkinter.simpledialog(Tk)Simple dialog windows
tkinter.tixTk Extension Widgets for Tkinter
tkinter.ttkTk themed widget set
tokenConstants representing terminal nodes of the parse tree.
tokenizeLexical scanner for Python source code.
traceTrace or track Python statement execution.
tracebackPrint or retrieve a stack traceback.
tracemallocTrace memory allocations.
tty(Unix)Utility functions that perform common terminal control operations.
turtleAn educational framework for simple graphics applications
turtledemoA viewer for example turtle scripts
typesNames for built-in types.
typingSupport for type hints (see :pep:`484`).
u
unicodedataAccess the Unicode Database.
unittestUnit testing framework for Python.
unittest.mockMock object library.
urllib
urllib.errorException classes raised by urllib.request.
urllib.parseParse URLs into or assemble them from components.
urllib.requestExtensible library for opening URLs.
urllib.responseResponse classes used by urllib.
urllib.robotparserLoad a robots.txt file and answer questions about fetchability of other URLs.
uuDeprecated:Encode and decode files in uuencode format.
uuidUUID objects (universally unique identifiers) according to RFC 4122
v
venvCreation of virtual environments.
w
warningsIssue warning messages and control their disposition.
waveProvide an interface to the WAV sound format.
weakrefSupport for weak references and weak dictionaries.
webbrowserEasy-to-use controller for web browsers.
winreg(Windows)Routines and objects for manipulating the Windows registry.
winsound(Windows)Access to the sound-playing machinery for Windows.
wsgirefWSGI Utilities and Reference Implementation.
wsgiref.handlersWSGI server/gateway base classes.
wsgiref.headersWSGI response header tools.
wsgiref.simple_serverA simple WSGI HTTP server.
wsgiref.utilWSGI environment utilities.
wsgiref.validateWSGI conformance checker.
x
xdrlibDeprecated:Encoders and decoders for the External Data Representation (XDR).
xmlPackage containing XML processing modules
xml.domDocument Object Model API for Python.
xml.dom.minidomMinimal Document Object Model (DOM) implementation.
xml.dom.pulldomSupport for building partial DOM trees from SAX events.
xml.etree.ElementTreeImplementation of the ElementTree API.
xml.parsers.expatAn interface to the Expat non-validating XML parser.
xml.parsers.expat.errors
xml.parsers.expat.model
xml.saxPackage containing SAX2 base classes and convenience functions.
xml.sax.handlerBase classes for SAX event handlers.
xml.sax.saxutilsConvenience functions and classes for use with SAX.
xml.sax.xmlreaderInterface which SAX-compliant XML parsers must implement.
xmlrpc
xmlrpc.clientXML-RPC client access.
xmlrpc.serverBasic XML-RPC server implementations.
z
zipappManage executable Python zip archives
zipfileRead and write ZIP-format archive files.
zipimportSupport for importing Python modules from ZIP archives.
zlibLow-level interface to compression and decompression routines compatible with gzip.
zoneinfoIANA time zone support