Python标准库 --- 内置模块汇总(字母排序)

Standard Module List


点击Module名字,可导航至python官方的Python Document相关模块说明。

若是英文阅读吃力,可在参考本文件夹下相关模块内容后,再行阅读(可能也没必要阅读了)。

以下列表,内置模块总计205个。

嗯,所以当你用到的时候再来查阅就好了,

单独全面学习的话,我也没说不好。。。


_
__future__Future statement definitions
__main__The environment where the top-level script is run.
_threadLow-level threading API.
a
abcAbstract base classes according to :pep:3119.
aifcRead 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.
asynchatSupport for asynchronous command/response protocols.
asyncioAsynchronous I/O.
asyncoreA base class for developing asynchronous socket handling services.
atexitRegister and execute cleanup functions.
audioopManipulate raw audio data.
b
base64RFC 3548: 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.
cgiHelpers for running Python scripts via the Common Gateway Interface.
cgitbConfigurable traceback handler for CGI scripts.
chunkModule 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
colorsysConversion functions between RGB and other color systems.
compileallTools for byte-compiling all Python source files in a directory tree.
concurrent
configparserConfiguration file parser.
contextlibUtilities for with-statement contexts.
contextvarsContext Variables
copyShallow and deep copy operations.
copyregRegister pickle support functions.
cProfile
crypt (Unix)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.
d
dataclassesGenerate special methods on user-defined classes.
datetimeBasic date and time types.
dbmInterfaces to various Unix “database” formats.
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.
doctestTest pieces of code within docstrings.
e
emailPackage supporting the parsing, manipulating, and generating email messages.
encodings
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.
formatter已移除: Generic output formatter and device interface.
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.
httpHTTP status codes and messages
i
imaplibIMAP4 protocol client (requires sockets).
imghdrDetermine the type of image contained in a file or byte stream.
imp已移除: Access the implementation of the import statement.
importlibThe implementation of the import machinery.
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.
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.
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)Creation of Microsoft Installer files, and CAB files.
msvcrt (Windows)Miscellaneous useful routines from the MS VC++ runtime.
multiprocessingProcess-based parallelism.
n
netrcLoading of .netrc files.
nis (Unix)Interface to Sun’s NIS (Yellow Pages) library.
nntplibNNTP protocol client (requires sockets).
numbersNumeric abstract base classes (Complex, Real, Integral, etc.).
o
operatorFunctions corresponding to the standard operators.
optparse已移除: Command-line option parsing library.
osMiscellaneous operating system interfaces.
ossaudiodev (Linux, FreeBSD)Access to OSS-compatible audio devices.
p
parserAccess parse trees for Python source code.
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)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 (Linux)Pseudo-Terminal Handling for Linux.
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.
smtpdA SMTP server implementation in Python.
smtplibSMTP protocol client (requires sockets).
sndhdrDetermine type of a sound file.
socketLow-level networking interface.
socketserverA framework for network servers.
spwd (Unix)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.
sunauProvide an interface to the Sun AU sound format.
symbolConstants representing internal nodes of the parse tree.
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.
telnetlibTelnet client class.
tempfileGenerate temporary files and directories.
termios (Unix)POSIX style tty control.
testRegression tests package containing the testing suite for Python.
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
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.
urllib
uuEncode 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.
x
xdrlibEncoders and decoders for the External Data Representation (XDR).
xmlPackage containing XML processing modules
xmlrpc
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

欢迎关注公众号TechGuy

  • 4
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值