Python 說明文件內容¶
- Python 有什麼新功能?
- Python 3.12 有什麼新功能
- Python 3.11 有什麼新功能
- Python 3.10 有什麼新功能
- 摘要 -- 發布重點
- 新功能
- 與型別提示相關的新功能
- 其他語言更動
- 新模組
- 改進的模組
- asyncio
- argparse
- array
- asynchat, asyncore, smtpd
- base64
- bdb
- bisect
- codecs
- collections.abc
- contextlib
- curses
- dataclasses
- distutils
- doctest
- encodings
- enum
- fileinput
- faulthandler
- gc
- glob
- hashlib
- hmac
- IDLE 和 idlelib
- importlib.metadata
- inspect
- itertools
- linecache
- os
- os.path
- pathlib
- platform
- pprint
- py_compile
- pyclbr
- shelve
- statistics
- site
- socket
- ssl
- sqlite3
- sys
- _thread
- threading
- traceback
- types
- typing
- unittest
- urllib.parse
- xml
- zipimport
- 最佳化
- 已棄用
- 已刪除
- 移植到 Python 3.10
- CPython 位元組碼更改
- 建置變更
- C API 變更
- Python 3.9 有什麼新功能
- Python 3.8 有什麼新功能
- Summary -- Release highlights
- New Features
- Assignment expressions
- Positional-only parameters
- Parallel filesystem cache for compiled bytecode files
- Debug build uses the same ABI as release build
- f-strings support
=
for self-documenting expressions and debugging - PEP 578: Python Runtime Audit Hooks
- PEP 587: Python Initialization Configuration
- PEP 590: Vectorcall: a fast calling protocol for CPython
- Pickle protocol 5 with out-of-band data buffers
- 其他語言更動
- 新增模組
- 改進的模組
- ast
- asyncio
- builtins(內建)
- collections
- cProfile
- csv
- curses
- ctypes
- datetime
- functools
- gc
- gettext
- gzip
- IDLE and idlelib
- inspect
- io
- itertools
- json.tool
- logging
- math
- mmap
- multiprocessing
- os
- os.path
- pathlib
- pickle
- plistlib
- pprint
- py_compile
- shlex
- shutil
- socket
- ssl
- statistics
- sys
- tarfile
- threading
- tokenize
- tkinter
- time
- typing
- unicodedata
- unittest
- venv
- weakref
- xml
- xmlrpc
- 最佳化
- Build and C API Changes
- 已棄用
- API and Feature Removals
- Porting to Python 3.8
- Notable changes in Python 3.8.1
- Notable changes in Python 3.8.8
- Notable changes in Python 3.8.12
- Python 3.7 有什麼新功能
- Summary -- Release Highlights
- New Features
- PEP 563: Postponed Evaluation of Annotations
- PEP 538: Legacy C Locale Coercion
- PEP 540: Forced UTF-8 Runtime Mode
- PEP 553: Built-in
breakpoint()
- PEP 539: New C API for Thread-Local Storage
- PEP 562: Customization of Access to Module Attributes
- PEP 564: New Time Functions With Nanosecond Resolution
- PEP 565: Show DeprecationWarning in
__main__
- PEP 560: Core Support for
typing
module and Generic Types - PEP 552: Hash-based .pyc Files
- PEP 545:Python 文件翻譯
- Python Development Mode (-X dev)
- 其他語言更動
- 新模組
- 改進的模組
- argparse
- asyncio
- binascii
- calendar
- collections
- compileall
- concurrent.futures
- contextlib
- cProfile
- crypt
- datetime
- dbm
- decimal
- dis
- distutils
- enum
- functools
- gc
- hmac
- http.client
- http.server
- idlelib and IDLE
- importlib
- io
- ipaddress
- itertools
- locale
- logging
- math
- mimetypes
- msilib
- multiprocessing
- os
- pathlib
- pdb
- py_compile
- pydoc
- queue
- re
- signal
- socket
- socketserver
- sqlite3
- ssl
- string
- subprocess
- sys
- time
- tkinter
- tracemalloc
- types
- unicodedata
- unittest
- unittest.mock
- urllib.parse
- uu
- uuid
- warnings
- xml.etree
- xmlrpc.server
- zipapp
- zipfile
- C API 變更
- Build Changes
- 最佳化
- Other CPython Implementation Changes
- Deprecated Python Behavior
- Deprecated Python modules, functions and methods
- Deprecated functions and types of the C API
- Platform Support Removals
- API and Feature Removals
- Module Removals
- Windows-only Changes
- Porting to Python 3.7
- Notable changes in Python 3.7.1
- Notable changes in Python 3.7.2
- Notable changes in Python 3.7.6
- Notable changes in Python 3.7.10
- Python 3.6 有什麼新功能
- Summary -- Release highlights
- New Features
- PEP 498: Formatted string literals
- PEP 526: Syntax for variable annotations
- PEP 515: Underscores in Numeric Literals
- PEP 525: Asynchronous Generators
- PEP 530: Asynchronous Comprehensions
- PEP 487: Simpler customization of class creation
- PEP 487: Descriptor Protocol Enhancements
- PEP 519: Adding a file system path protocol
- PEP 495: Local Time Disambiguation
- PEP 529: Change Windows filesystem encoding to UTF-8
- PEP 528: Change Windows console encoding to UTF-8
- PEP 520: Preserving Class Attribute Definition Order
- PEP 468: Preserving Keyword Argument Order
- New dict implementation
- PEP 523: Adding a frame evaluation API to CPython
- PYTHONMALLOC environment variable
- DTrace and SystemTap probing support
- 其他語言更動
- 新模組
- 改進的模組
- array
- ast
- asyncio
- binascii
- cmath
- collections
- concurrent.futures
- contextlib
- datetime
- decimal
- distutils
- encodings
- enum
- faulthandler
- fileinput
- hashlib
- http.client
- idlelib and IDLE
- importlib
- inspect
- json
- logging
- math
- multiprocessing
- os
- pathlib
- pdb
- pickle
- pickletools
- pydoc
- random
- re
- readline
- rlcompleter
- shlex
- site
- sqlite3
- socket
- socketserver
- ssl
- statistics
- struct
- subprocess
- sys
- telnetlib
- time
- timeit
- tkinter
- traceback
- tracemalloc
- typing
- unicodedata
- unittest.mock
- urllib.request
- urllib.robotparser
- venv
- warnings
- winreg
- winsound
- xmlrpc.client
- zipfile
- zlib
- 最佳化
- Build and C API Changes
- Other Improvements
- 已棄用
- 已移除
- Porting to Python 3.6
- Notable changes in Python 3.6.2
- Notable changes in Python 3.6.4
- Notable changes in Python 3.6.5
- Notable changes in Python 3.6.7
- Notable changes in Python 3.6.10
- Notable changes in Python 3.6.13
- Python 3.4 有什麼新功能
- Summary -- Release highlights
- New Features
- PEP 492 - Coroutines with async and await syntax
- PEP 465 - A dedicated infix operator for matrix multiplication
- PEP 448 - Additional Unpacking Generalizations
- PEP 461 - percent formatting support for bytes and bytearray
- PEP 484 - Type Hints
- PEP 471 - os.scandir() function -- a better and faster directory iterator
- PEP 475: Retry system calls failing with EINTR
- PEP 479: Change StopIteration handling inside generators
- PEP 485: A function for testing approximate equality
- PEP 486: Make the Python Launcher aware of virtual environments
- PEP 488: Elimination of PYO files
- PEP 489: Multi-phase extension module initialization
- 其他語言更動
- 新增模組
- 改進的模組
- argparse
- asyncio
- bz2
- cgi
- cmath
- code
- collections
- collections.abc
- compileall
- concurrent.futures
- configparser
- contextlib
- csv
- curses
- dbm
- difflib
- distutils
- doctest
- enum
- faulthandler
- functools
- glob
- gzip
- heapq
- http
- http.client
- idlelib and IDLE
- imaplib
- imghdr
- importlib
- inspect
- io
- ipaddress
- json
- linecache
- locale
- logging
- lzma
- math
- multiprocessing
- operator
- os
- pathlib
- pickle
- poplib
- re
- readline
- selectors
- shutil
- signal
- smtpd
- smtplib
- sndhdr
- socket
- ssl
- sqlite3
- subprocess
- sys
- sysconfig
- tarfile
- threading
- time
- timeit
- tkinter
- traceback
- types
- unicodedata
- unittest
- unittest.mock
- urllib
- wsgiref
- xmlrpc
- xml.sax
- zipfile
- Other module-level changes
- 最佳化
- Build and C API Changes
- 已棄用
- 已移除
- Porting to Python 3.5
- Notable changes in Python 3.5.4
- Python 3.4 有什麼新功能
- Summary -- Release Highlights
- New Features
- 新模組
- 改進的模組
- abc
- aifc
- argparse
- audioop
- base64
- collections
- colorsys
- contextlib
- dbm
- dis
- doctest
- filecmp
- functools
- gc
- glob
- hashlib
- hmac
- html
- http
- idlelib 與 IDLE
- importlib
- inspect
- ipaddress
- logging
- marshal
- mmap
- multiprocessing
- operator
- os
- pdb
- pickle
- plistlib
- poplib
- pprint
- pty
- pydoc
- re
- resource
- select
- shelve
- shutil
- smtpd
- smtplib
- socket
- sqlite3
- ssl
- stat
- struct
- subprocess
- sunau
- sys
- tarfile
- textwrap
- threading
- traceback
- types
- urllib
- unittest
- venv
- wave
- weakref
- xml.etree
- zipfile
- CPython 實作變更
- 已棄用
- 已移除
- Porting to Python 3.4
- 3.4.3 中的變更
- Python 3.3 有什麼新功能
- Summary -- Release highlights
- PEP 405:虛擬環境
- PEP 420: Implicit Namespace Packages
- PEP 3118: New memoryview implementation and buffer protocol documentation
- PEP 393: Flexible String Representation
- PEP 397:適用於 Windows 的 Python 啟動器
- PEP 3151: Reworking the OS and IO exception hierarchy
- PEP 380: Syntax for Delegating to a Subgenerator
- PEP 409: Suppressing exception context
- PEP 414: Explicit Unicode literals
- PEP 3155: Qualified name for classes and functions
- PEP 412: Key-Sharing Dictionary
- PEP 362:函式簽名物件
- PEP 421:新增 sys.implementation
- 使用 importlib 作為 import 的實作
- 其他語言更動
- A Finer-Grained Import Lock
- 內建函式和型別
- 新模組
- 改進的模組
- abc
- array
- base64
- binascii
- bz2
- codecs
- collections
- contextlib
- crypt
- curses
- datetime
- decimal
- ftplib
- functools
- gc
- hmac
- http
- html
- imaplib
- inspect
- io
- itertools
- logging
- math
- mmap
- multiprocessing
- nntplib
- os
- pdb
- pickle
- pydoc
- re
- sched
- select
- shlex
- shutil
- signal
- smtpd
- smtplib
- socket
- socketserver
- sqlite3
- ssl
- stat
- struct
- subprocess
- sys
- tarfile
- tempfile
- textwrap
- threading
- time
- types
- unittest
- urllib
- webbrowser
- xml.etree.ElementTree
- zlib
- 最佳化
- 建置和 C API 更改
- 已棄用
- 移植到 Python 3.3
- Python 3.2 有什麼新功能
- PEP 384: Defining a Stable ABI
- PEP 389: Argparse Command Line Parsing Module
- PEP 391: Dictionary Based Configuration for Logging
- PEP 3148: The
concurrent.futures
module - PEP 3147: PYC Repository Directories
- PEP 3149: ABI Version Tagged .so Files
- PEP 3333: Python Web Server Gateway Interface v1.0.1
- 其他語言更動
- New, Improved, and Deprecated Modules
- elementtree
- functools
- itertools
- collections
- threading
- datetime 和 time
- math
- abc
- io
- reprlib
- logging
- csv
- contextlib
- decimal and fractions
- ftp
- popen
- select
- gzip 和 zipfile
- tarfile
- hashlib
- ast
- os
- shutil
- sqlite3
- html
- socket
- ssl
- nntp
- certificates
- imaplib
- http.client
- unittest
- random
- poplib
- asyncore
- tempfile
- inspect
- pydoc
- dis
- dbm
- ctypes
- site
- sysconfig
- pdb
- configparser
- urllib.parse
- mailbox
- turtledemo
- Multi-threading
- 最佳化
- Unicode
- Codecs
- 文件
- IDLE
- Code Repository
- Build and C API Changes
- Porting to Python 3.2
- Python 3.1 有什麼新功能
- Python 3.0 有什麼新功能
- Python 2.7 有什麼新功能
- The Future for Python 2.x
- Changes to the Handling of Deprecation Warnings
- Python 3.1 Features
- PEP 372: Adding an Ordered Dictionary to collections
- PEP 378: Format Specifier for Thousands Separator
- PEP 389: The argparse Module for Parsing Command Lines
- PEP 391: Dictionary-Based Configuration For Logging
- PEP 3106: Dictionary Views
- PEP 3137: The memoryview Object
- 其他語言更動
- New and Improved Modules
- Build and C API Changes
- Other Changes and Fixes
- Porting to Python 2.7
- New Features Added to Python 2.7 Maintenance Releases
- Two new environment variables for debug mode
- PEP 434: IDLE Enhancement Exception for All Branches
- PEP 466: Network Security Enhancements for Python 2.7
- PEP 477: Backport ensurepip (PEP 453) to Python 2.7
- PEP 476: Enabling certificate verification by default for stdlib http clients
- PEP 493: HTTPS verification migration tools for Python 2.7
- New
make regen-all
build target - Removal of
make touch
build target
- 致謝
- Python 2.6 有什麼新功能
- Python 3.0
- Changes to the Development Process
- PEP 343: The 'with' statement
- PEP 366: Explicit Relative Imports From a Main Module
- PEP 370: Per-user
site-packages
Directory - PEP 371: The
multiprocessing
Package - PEP 3101: Advanced String Formatting
- PEP 3105:
print
As a Function - PEP 3110: Exception-Handling Changes
- PEP 3112: Byte Literals
- PEP 3116: New I/O Library
- PEP 3118:修訂緩衝協定
- PEP 3119: Abstract Base Classes
- PEP 3127: Integer Literal Support and Syntax
- PEP 3129: Class Decorators
- PEP 3141: A Type Hierarchy for Numbers
- 其他語言更動
- New and Improved Modules
- Deprecations and Removals
- Build and C API Changes
- Porting to Python 2.6
- 致謝
- Python 2.5 有什麼新功能
- PEP 308: Conditional Expressions
- PEP 309: Partial Function Application
- PEP 314: Metadata for Python Software Packages v1.1
- PEP 328: Absolute and Relative Imports
- PEP 338: Executing Modules as Scripts
- PEP 341: Unified try/except/finally
- PEP 342: New Generator Features
- PEP 343: The 'with' statement
- PEP 352: Exceptions as New-Style Classes
- PEP 353: Using ssize_t as the index type
- PEP 357: The '__index__' method
- 其他語言更動
- New, Improved, and Removed Modules
- Build and C API Changes
- Porting to Python 2.5
- 致謝
- Python 2.4 有什麼新功能
- PEP 218: Built-In Set Objects
- PEP 237: Unifying Long Integers and Integers
- PEP 289: Generator Expressions
- PEP 292: Simpler String Substitutions
- PEP 318: Decorators for Functions and Methods
- PEP 322: Reverse Iteration
- PEP 324: New subprocess Module
- PEP 327: Decimal Data Type
- PEP 328: Multi-line Imports
- PEP 331: Locale-Independent Float/String Conversions
- 其他語言更動
- New, Improved, and Deprecated Modules
- Build and C API Changes
- Porting to Python 2.4
- 致謝
- Python 2.3 有什麼新功能
- PEP 218: A Standard Set Datatype
- PEP 255: Simple Generators
- PEP 263: Source Code Encodings
- PEP 273: Importing Modules from ZIP Archives
- PEP 277: Unicode file name support for Windows NT
- PEP 278: Universal Newline Support
- PEP 279: enumerate()
- PEP 282: The logging Package
- PEP 285: A Boolean Type
- PEP 293: Codec Error Handling Callbacks
- PEP 301: Package Index and Metadata for Distutils
- PEP 302: New Import Hooks
- PEP 305: Comma-separated Files
- PEP 307: Pickle Enhancements
- Extended Slices
- 其他語言更動
- New, Improved, and Deprecated Modules
- Pymalloc: A Specialized Object Allocator
- Build and C API Changes
- Other Changes and Fixes
- Porting to Python 2.3
- 致謝
- Python 2.2 有什麼新功能
- Python 2.1 有什麼新功能
- 簡介
- PEP 227: Nested Scopes
- PEP 236: __future__ Directives
- PEP 207: Rich Comparisons
- PEP 230: Warning Framework
- PEP 229: New Build System
- PEP 205: Weak References
- PEP 232: Function Attributes
- PEP 235: Importing Modules on Case-Insensitive Platforms
- PEP 217: Interactive Display Hook
- PEP 208: New Coercion Model
- PEP 241: Metadata in Python Packages
- New and Improved Modules
- Other Changes and Fixes
- 致謝
- Python 2.0 有什麼新功能
- 簡介
- What About Python 1.6?
- New Development Process
- Unicode
- 串列綜合運算(List Comprehension)
- Augmented Assignment
- String Methods
- Garbage Collection of Cycles
- Other Core Changes
- Porting to 2.0
- Extending/Embedding Changes
- Distutils: Making Modules Easy to Install
- XML 模組
- 模組變更
- 新增模組
- IDLE Improvements
- Deleted and Deprecated Modules
- 致謝
- Changelog(更動日誌)
- Python next
- Python 3.12.1 final
- Python 3.12.0 final
- Python 3.12.0 release candidate 3
- Python 3.12.0 release candidate 2
- Python 3.12.0 release candidate 1
- Python 3.12.0 beta 4
- Python 3.12.0 beta 3
- Python 3.12.0 beta 2
- Python 3.12.0 beta 1
- Python 3.12.0 alpha 7
- Python 3.12.0 alpha 6
- Python 3.12.0 alpha 5
- Python 3.12.0 alpha 4
- Python 3.12.0 alpha 3
- Python 3.12.0 alpha 2
- Python 3.12.0 alpha 1
- Python 3.11.0 beta 1
- Python 3.11.0 alpha 7
- Python 3.11.0 alpha 6
- Python 3.11.0 alpha 5
- Python 3.11.0 alpha 4
- Python 3.11.0 alpha 3
- Python 3.11.0 alpha 2
- Python 3.11.0 alpha 1
- Python 3.10.0 beta 1
- Python 3.10.0 alpha 7
- Python 3.10.0 alpha 6
- Python 3.10.0 alpha 5
- Python 3.10.0 alpha 4
- Python 3.10.0 alpha 3
- Python 3.10.0 alpha 2
- Python 3.10.0 alpha 1
- Python 3.9.0 beta 1
- Python 3.9.0 alpha 6
- Python 3.9.0 alpha 5
- Python 3.9.0 alpha 4
- Python 3.9.0 alpha 3
- Python 3.9.0 alpha 2
- Python 3.9.0 alpha 1
- Python 3.8.0 beta 1
- Python 3.8.0 alpha 4
- Python 3.8.0 alpha 3
- Python 3.8.0 alpha 2
- Python 3.8.0 alpha 1
- Python 3.7.0 final
- Python 3.7.0 release candidate 1
- Python 3.7.0 beta 5
- Python 3.7.0 beta 4
- Python 3.7.0 beta 3
- Python 3.7.0 beta 2
- Python 3.7.0 beta 1
- Python 3.7.0 alpha 4
- Python 3.7.0 alpha 3
- Python 3.7.0 alpha 2
- Python 3.7.0 alpha 1
- Python 3.6.6 final
- Python 3.6.6 release candidate 1
- Python 3.6.5 final
- Python 3.6.5 release candidate 1
- Python 3.6.4 final
- Python 3.6.4 release candidate 1
- Python 3.6.3 final
- Python 3.6.3 release candidate 1
- Python 3.6.2 final
- Python 3.6.2 release candidate 2
- Python 3.6.2 release candidate 1
- Python 3.6.1 final
- Python 3.6.1 release candidate 1
- Python 3.6.0 final
- Python 3.6.0 release candidate 2
- Python 3.6.0 release candidate 1
- Python 3.6.0 beta 4
- Python 3.6.0 beta 3
- Python 3.6.0 beta 2
- Python 3.6.0 beta 1
- Python 3.6.0 alpha 4
- Python 3.6.0 alpha 3
- Python 3.6.0 alpha 2
- Python 3.6.0 alpha 1
- Python 3.5.5 final
- Python 3.5.5 release candidate 1
- Python 3.5.4 final
- Python 3.5.4 release candidate 1
- Python 3.5.3 final
- Python 3.5.3 release candidate 1
- Python 3.5.2 final
- Python 3.5.2 release candidate 1
- Python 3.5.1 final
- Python 3.5.1 release candidate 1
- Python 3.5.0 final
- Python 3.5.0 release candidate 4
- Python 3.5.0 release candidate 3
- Python 3.5.0 release candidate 2
- Python 3.5.0 release candidate 1
- Python 3.5.0 beta 4
- Python 3.5.0 beta 3
- Python 3.5.0 beta 2
- Python 3.5.0 beta 1
- Python 3.5.0 alpha 4
- Python 3.5.0 alpha 3
- Python 3.5.0 alpha 2
- Python 3.5.0 alpha 1
- Python 教學
- 1. 淺嘗滋味
- 2. 使用 Python 直譯器
- 3. 一個非正式的 Python 簡介
- 4. 深入了解流程控制
- 4.1.
if
陳述式 - 4.2.
for
陳述式 - 4.3.
range()
函式 - 4.4. 迴圈內的
break
和continue
陳述式及else
子句 - 4.5.
pass
陳述式 - 4.6.
match
陳述式 - 4.7. 定義函式 (function)
- 4.8. 深入了解函式定義
- 4.9. 間奏曲:程式碼風格 (Coding Style)
- 4.1.
- 5. 資料結構
- 6. 模組 (Module)
- 7. 輸入和輸出
- 8. 錯誤和例外
- 9. Class(類別)
- 10. Python 標準函式庫概覽
- 11. Python 標準函式庫概覽——第二部份
- 12. 虛擬環境與套件
- 13. 現在可以來學習些什麼?
- 14. 互動式輸入編輯和歷史記錄替換
- 15. 浮點數運算:問題與限制
- 16. 附錄
- Python 的設置與使用
- 1. 命令列與環境
- 2. 在 Unix 平臺上使用 Python
- 3. 配置 Python
- 4. 在 Windows 上使用 Python
- 4.1. The full installer
- 4.2. The Microsoft Store package
- 4.3. nuget.org 套件
- 4.4. The embeddable package
- 4.5. Alternative bundles
- 4.6. 設定 Python
- 4.7. UTF-8 模式
- 4.8. Python Launcher for Windows
- 4.9. Finding modules
- 4.10. Additional modules
- 4.11. 編譯 Python 在 Windows
- 4.12. 其他平台
- 5. 在 Mac 系統使用 Python
- 6. 編輯器與 IDE
- Python 語言參考手冊
- 1. 簡介
- 2. Lexical analysis
- 3. Data model
- 3.1. Objects, values and types
- 3.2. 標準型別階層
- 3.2.1. None
- 3.2.2. NotImplemented
- 3.2.3. Ellipsis
- 3.2.4.
numbers.Number
- 3.2.5. Sequences
- 3.2.6. Set types
- 3.2.7. Mappings
- 3.2.8. Callable types
- 3.2.8.1. User-defined functions
- 3.2.8.2. Instance methods
- 3.2.8.3. Generator functions
- 3.2.8.4. Coroutine functions
- 3.2.8.5. Asynchronous generator functions
- 3.2.8.6. Built-in functions
- 3.2.8.7. Built-in methods
- 3.2.8.8. Classes
- 3.2.8.9. Class Instances
- 3.2.9. 模組
- 3.2.10. Custom classes
- 3.2.11. Class instances
- 3.2.12. I/O objects (also known as file objects)
- 3.2.13. Internal types
- 3.2.13.1. Code objects
- 3.2.13.1.1. Special read-only attributes
codeobject.co_name
codeobject.co_qualname
codeobject.co_argcount
codeobject.co_posonlyargcount
codeobject.co_kwonlyargcount
codeobject.co_nlocals
codeobject.co_varnames
codeobject.co_cellvars
codeobject.co_freevars
codeobject.co_code
codeobject.co_consts
codeobject.co_names
codeobject.co_filename
codeobject.co_firstlineno
codeobject.co_lnotab
codeobject.co_stacksize
codeobject.co_flags
- 3.2.13.1.2. Methods on code objects
- 3.2.13.1.1. Special read-only attributes
- 3.2.13.2. Frame objects
- 3.2.13.3. Traceback objects
- 3.2.13.4. Slice objects
- 3.2.13.5. Static method objects
- 3.2.13.6. Class method objects
- 3.2.13.1. Code objects
- 3.3. Special method names
- 3.3.1. Basic customization
- 3.3.2. Customizing attribute access
- 3.3.3. Customizing class creation
- 3.3.4. Customizing instance and subclass checks
- 3.3.5. Emulating generic types
- 3.3.6. Emulating callable objects
- 3.3.7. Emulating container types
- 3.3.8. Emulating numeric types
object.__add__()
object.__sub__()
object.__mul__()
object.__matmul__()
object.__truediv__()
object.__floordiv__()
object.__mod__()
object.__divmod__()
object.__pow__()
object.__lshift__()
object.__rshift__()
object.__and__()
object.__xor__()
object.__or__()
object.__radd__()
object.__rsub__()
object.__rmul__()
object.__rmatmul__()
object.__rtruediv__()
object.__rfloordiv__()
object.__rmod__()
object.__rdivmod__()
object.__rpow__()
object.__rlshift__()
object.__rrshift__()
object.__rand__()
object.__rxor__()
object.__ror__()
object.__iadd__()
object.__isub__()
object.__imul__()
object.__imatmul__()
object.__itruediv__()
object.__ifloordiv__()
object.__imod__()
object.__ipow__()
object.__ilshift__()
object.__irshift__()
object.__iand__()
object.__ixor__()
object.__ior__()
object.__neg__()
object.__pos__()
object.__abs__()
object.__invert__()
object.__complex__()
object.__int__()
object.__float__()
object.__index__()
object.__round__()
object.__trunc__()
object.__floor__()
object.__ceil__()
- 3.3.9. With Statement Context Managers
- 3.3.10. Customizing positional arguments in class pattern matching
- 3.3.11. Emulating buffer types
- 3.3.12. Special method lookup
- 3.4. 協程
- 4. Execution model
- 5. The import system
- 6. Expressions
- 6.1. Arithmetic conversions
- 6.2. Atoms
- 6.3. Primaries
- 6.4. Await expression
- 6.5. The power operator
- 6.6. Unary arithmetic and bitwise operations
- 6.7. Binary arithmetic operations
- 6.8. Shifting operations
- 6.9. Binary bitwise operations
- 6.10. Comparisons
- 6.11. Boolean operations
- 6.12. Assignment expressions
- 6.13. Conditional expressions
- 6.14. Lambdas
- 6.15. Expression lists
- 6.16. Evaluation order
- 6.17. Operator precedence
- 7. Simple statements
- 7.1. Expression statements
- 7.2. Assignment statements
- 7.3. The
assert
statement - 7.4. The
pass
statement - 7.5. The
del
statement - 7.6. The
return
statement - 7.7. The
yield
statement - 7.8. The
raise
statement - 7.9. The
break
statement - 7.10. The
continue
statement - 7.11. The
import
statement - 7.12. The
global
statement - 7.13. The
nonlocal
statement - 7.14. The
type
statement
- 8. Compound statements
- 9. 最高層級元件
- 10. 完整的語法規格書
- Python 標準函式庫 (Standard Library)
- 簡介
- 內建函式
abs()
aiter()
all()
anext()
any()
ascii()
bin()
bool
breakpoint()
callable()
chr()
classmethod()
compile()
complex
delattr()
dir()
divmod()
enumerate()
eval()
exec()
filter()
float
format()
getattr()
globals()
hasattr()
hash()
help()
hex()
id()
input()
int
isinstance()
issubclass()
iter()
len()
locals()
map()
max()
min()
next()
object
oct()
open()
ord()
pow()
print()
property
repr()
reversed()
round()
setattr()
slice
sorted()
staticmethod()
sum()
super
type
vars()
zip()
__import__()
- 內建常數
- 內建型別
- 真值檢測
- Boolean(布林)運算 ---
and
,or
,not
- 比較運算
- Numeric Types ---
int
,float
,complex
- Boolean Type -
bool
- Iterator Types
- Sequence Types ---
list
,tuple
,range
- Text Sequence Type ---
str
str
- String Methods
str.capitalize()
str.casefold()
str.center()
str.count()
str.encode()
str.endswith()
str.expandtabs()
str.find()
str.format()
str.format_map()
str.index()
str.isalnum()
str.isalpha()
str.isascii()
str.isdecimal()
str.isdigit()
str.isidentifier()
str.islower()
str.isnumeric()
str.isprintable()
str.isspace()
str.istitle()
str.isupper()
str.join()
str.ljust()
str.lower()
str.lstrip()
str.maketrans()
str.partition()
str.removeprefix()
str.removesuffix()
str.replace()
str.rfind()
str.rindex()
str.rjust()
str.rpartition()
str.rsplit()
str.rstrip()
str.split()
str.splitlines()
str.startswith()
str.strip()
str.swapcase()
str.title()
str.translate()
str.upper()
str.zfill()
printf
-style String Formatting
- Binary Sequence Types ---
bytes
,bytearray
,memoryview
- Bytes Objects
- Bytearray Objects
- Bytes and Bytearray Operations
bytes.count()
bytearray.count()
bytes.removeprefix()
bytearray.removeprefix()
bytes.removesuffix()
bytearray.removesuffix()
bytes.decode()
bytearray.decode()
bytes.endswith()
bytearray.endswith()
bytes.find()
bytearray.find()
bytes.index()
bytearray.index()
bytes.join()
bytearray.join()
bytes.maketrans()
bytearray.maketrans()
bytes.partition()
bytearray.partition()
bytes.replace()
bytearray.replace()
bytes.rfind()
bytearray.rfind()
bytes.rindex()
bytearray.rindex()
bytes.rpartition()
bytearray.rpartition()
bytes.startswith()
bytearray.startswith()
bytes.translate()
bytearray.translate()
bytes.center()
bytearray.center()
bytes.ljust()
bytearray.ljust()
bytes.lstrip()
bytearray.lstrip()
bytes.rjust()
bytearray.rjust()
bytes.rsplit()
bytearray.rsplit()
bytes.rstrip()
bytearray.rstrip()
bytes.split()
bytearray.split()
bytes.strip()
bytearray.strip()
bytes.capitalize()
bytearray.capitalize()
bytes.expandtabs()
bytearray.expandtabs()
bytes.isalnum()
bytearray.isalnum()
bytes.isalpha()
bytearray.isalpha()
bytes.isascii()
bytearray.isascii()
bytes.isdigit()
bytearray.isdigit()
bytes.islower()
bytearray.islower()
bytes.isspace()
bytearray.isspace()
bytes.istitle()
bytearray.istitle()
bytes.isupper()
bytearray.isupper()
bytes.lower()
bytearray.lower()
bytes.splitlines()
bytearray.splitlines()
bytes.swapcase()
bytearray.swapcase()
bytes.title()
bytearray.title()
bytes.upper()
bytearray.upper()
bytes.zfill()
bytearray.zfill()
printf
-style Bytes Formatting- Memory Views
memoryview
memoryview.__eq__()
memoryview.tobytes()
memoryview.hex()
memoryview.tolist()
memoryview.toreadonly()
memoryview.release()
memoryview.cast()
memoryview.obj
memoryview.nbytes
memoryview.readonly
memoryview.format
memoryview.itemsize
memoryview.ndim
memoryview.shape
memoryview.strides
memoryview.suboffsets
memoryview.c_contiguous
memoryview.f_contiguous
memoryview.contiguous
- Set Types ---
set
,frozenset
set
frozenset
frozenset.isdisjoint()
frozenset.issubset()
frozenset.issuperset()
frozenset.union()
frozenset.intersection()
frozenset.difference()
frozenset.symmetric_difference()
frozenset.copy()
frozenset.update()
frozenset.intersection_update()
frozenset.difference_update()
frozenset.symmetric_difference_update()
frozenset.add()
frozenset.remove()
frozenset.discard()
frozenset.pop()
frozenset.clear()
- Mapping Types ---
dict
- Context Manager Types
- Type Annotation Types --- Generic Alias, Union
- Other Built-in Types
- Special Attributes
- Integer string conversion length limitation
- 內建的例外
- Exception context
- 繼承自內建的例外
- Base classes
- Concrete exceptions
AssertionError
AttributeError
EOFError
FloatingPointError
GeneratorExit
ImportError
ModuleNotFoundError
IndexError
KeyError
KeyboardInterrupt
MemoryError
NameError
NotImplementedError
OSError
OverflowError
RecursionError
ReferenceError
RuntimeError
StopIteration
StopAsyncIteration
SyntaxError
IndentationError
TabError
SystemError
SystemExit
TypeError
UnboundLocalError
UnicodeError
UnicodeEncodeError
UnicodeDecodeError
UnicodeTranslateError
ValueError
ZeroDivisionError
EnvironmentError
IOError
WindowsError
- OS exceptions
- 警告
- Exception groups
- Exception hierarchy
- 文本處理 (Text Processing) 服務
string
--- 常見的字串操作re
--- 正規表示式 (regular expression) 操作difflib
--- Helpers for computing deltasDiffer
HtmlDiff
context_diff()
get_close_matches()
ndiff()
restore()
unified_diff()
diff_bytes()
IS_LINE_JUNK()
IS_CHARACTER_JUNK()
- SequenceMatcher 物件
SequenceMatcher
SequenceMatcher.set_seqs()
SequenceMatcher.set_seq1()
SequenceMatcher.set_seq2()
SequenceMatcher.find_longest_match()
SequenceMatcher.get_matching_blocks()
SequenceMatcher.get_opcodes()
SequenceMatcher.get_grouped_opcodes()
SequenceMatcher.ratio()
SequenceMatcher.quick_ratio()
SequenceMatcher.real_quick_ratio()
- SequenceMatcher 範例
- Differ Objects
- Differ Example
- A command-line interface to difflib
- ndiff 範例:
textwrap
--- Text wrapping and fillingwrap()
fill()
shorten()
dedent()
indent()
TextWrapper
TextWrapper.width
TextWrapper.expand_tabs
TextWrapper.tabsize
TextWrapper.replace_whitespace
TextWrapper.drop_whitespace
TextWrapper.initial_indent
TextWrapper.subsequent_indent
TextWrapper.fix_sentence_endings
TextWrapper.break_long_words
TextWrapper.break_on_hyphens
TextWrapper.max_lines
TextWrapper.placeholder
TextWrapper.wrap()
TextWrapper.fill()
unicodedata
--- Unicode Databasestringprep
--- Internet String Preparationreadline
--- GNU readline interfacerlcompleter
--- Completion function for GNU readline
- 二進位資料服務
struct
--- Interpret bytes as packed binary datacodecs
--- Codec registry and base classesencode()
decode()
lookup()
CodecInfo
getencoder()
getdecoder()
getincrementalencoder()
getincrementaldecoder()
getreader()
getwriter()
register()
unregister()
open()
EncodedFile()
iterencode()
iterdecode()
BOM
BOM_BE
BOM_LE
BOM_UTF8
BOM_UTF16
BOM_UTF16_BE
BOM_UTF16_LE
BOM_UTF32
BOM_UTF32_BE
BOM_UTF32_LE
- Codec Base Classes
- Encodings and Unicode
- Standard Encodings
- Python Specific Encodings
encodings.idna
--- Internationalized Domain Names in Applicationsencodings.mbcs
--- Windows ANSI codepageencodings.utf_8_sig
--- UTF-8 codec with BOM signature
- 資料型別
datetime
--- 日期與時間的基本型別- Aware and Naive Objects
- 常數
- Available Types
timedelta
物件date
物件date
date.today()
date.fromtimestamp()
date.fromordinal()
date.fromisoformat()
date.fromisocalendar()
date.min
date.max
date.resolution
date.year
date.month
date.day
date.replace()
date.timetuple()
date.toordinal()
date.weekday()
date.isoweekday()
date.isocalendar()
date.isoformat()
date.__str__()
date.ctime()
date.strftime()
date.__format__()
- 用法範例:
date
datetime
物件datetime
datetime.today()
datetime.now()
datetime.utcnow()
datetime.fromtimestamp()
datetime.utcfromtimestamp()
datetime.fromordinal()
datetime.combine()
datetime.fromisoformat()
datetime.fromisocalendar()
datetime.strptime()
datetime.min
datetime.max
datetime.resolution
datetime.year
datetime.month
datetime.day
datetime.hour
datetime.minute
datetime.second
datetime.microsecond
datetime.tzinfo
datetime.fold
datetime.date()
datetime.time()
datetime.timetz()
datetime.replace()
datetime.astimezone()
datetime.utcoffset()
datetime.dst()
datetime.tzname()
datetime.timetuple()
datetime.utctimetuple()
datetime.toordinal()
datetime.timestamp()
datetime.weekday()
datetime.isoweekday()
datetime.isocalendar()
datetime.isoformat()
datetime.__str__()
datetime.ctime()
datetime.strftime()
datetime.__format__()
- Examples of Usage:
datetime
time
物件tzinfo
物件timezone
物件strftime()
與strptime()
的行為
zoneinfo
--- IANA 時區支援calendar
--- 日曆相關函式Calendar
Calendar.iterweekdays()
Calendar.itermonthdates()
Calendar.itermonthdays()
Calendar.itermonthdays2()
Calendar.itermonthdays3()
Calendar.itermonthdays4()
Calendar.monthdatescalendar()
Calendar.monthdays2calendar()
Calendar.monthdayscalendar()
Calendar.yeardatescalendar()
Calendar.yeardays2calendar()
Calendar.yeardayscalendar()
TextCalendar
HTMLCalendar
HTMLCalendar.formatmonth()
HTMLCalendar.formatyear()
HTMLCalendar.formatyearpage()
HTMLCalendar.formatmonthname()
HTMLCalendar.cssclasses
HTMLCalendar.cssclass_noday
HTMLCalendar.cssclasses_weekday_head
HTMLCalendar.cssclass_month_head
HTMLCalendar.cssclass_month
HTMLCalendar.cssclass_year
HTMLCalendar.cssclass_year_head
LocaleTextCalendar
LocaleHTMLCalendar
setfirstweekday()
firstweekday()
isleap()
leapdays()
weekday()
weekheader()
monthrange()
monthcalendar()
prmonth()
month()
prcal()
calendar()
timegm()
day_name
day_abbr
MONDAY
TUESDAY
WEDNESDAY
THURSDAY
FRIDAY
SATURDAY
SUNDAY
Day
month_name
month_abbr
JANUARY
FEBRUARY
MARCH
APRIL
MAY
JUNE
JULY
AUGUST
SEPTEMBER
OCTOBER
NOVEMBER
DECEMBER
Month
IllegalMonthError
IllegalWeekdayError
- 命令列用法
collections
--- 容器資料型態collections.abc
--- Abstract Base Classes for Containersheapq
--- 堆積佇列 (heap queue) 演算法bisect
--- 陣列二分演算法 (Array bisection algorithm)array
--- 高效率的數值型陣列typecodes
array
array.typecode
array.itemsize
array.append()
array.buffer_info()
array.byteswap()
array.count()
array.extend()
array.frombytes()
array.fromfile()
array.fromlist()
array.fromunicode()
array.index()
array.insert()
array.pop()
array.remove()
array.reverse()
array.tobytes()
array.tofile()
array.tolist()
array.tounicode()
weakref
--- Weak referencestypes
--- Dynamic type creation and names for built-in types- Dynamic Type Creation
- Standard Interpreter Types
NoneType
FunctionType
LambdaType
GeneratorType
CoroutineType
AsyncGeneratorType
CodeType
CellType
MethodType
BuiltinFunctionType
BuiltinMethodType
WrapperDescriptorType
MethodWrapperType
NotImplementedType
MethodDescriptorType
ClassMethodDescriptorType
ModuleType
EllipsisType
GenericAlias
UnionType
TracebackType
FrameType
GetSetDescriptorType
MemberDescriptorType
MappingProxyType
- Additional Utility Classes and Functions
- Coroutine Utility Functions
copy
--- 淺層 (shallow) 和深層 (deep) 複製操作pprint
--- Data pretty printerreprlib
--- Alternaterepr()
implementationenum
--- 對列舉的支援graphlib
—-- 使用類圖 (graph-like) 結構進行操作的功能
- 數值與數學模組
numbers
--- 數值的抽象基底類別math
--- 數學函式cmath
--- Mathematical functions for complex numbersdecimal
--- Decimal fixed point and floating point arithmetic- Quick-start Tutorial
- Decimal objects
Decimal
Decimal.adjusted()
Decimal.as_integer_ratio()
Decimal.as_tuple()
Decimal.canonical()
Decimal.compare()
Decimal.compare_signal()
Decimal.compare_total()
Decimal.compare_total_mag()
Decimal.conjugate()
Decimal.copy_abs()
Decimal.copy_negate()
Decimal.copy_sign()
Decimal.exp()
Decimal.from_float()
Decimal.fma()
Decimal.is_canonical()
Decimal.is_finite()
Decimal.is_infinite()
Decimal.is_nan()
Decimal.is_normal()
Decimal.is_qnan()
Decimal.is_signed()
Decimal.is_snan()
Decimal.is_subnormal()
Decimal.is_zero()
Decimal.ln()
Decimal.log10()
Decimal.logb()
Decimal.logical_and()
Decimal.logical_invert()
Decimal.logical_or()
Decimal.logical_xor()
Decimal.max()
Decimal.max_mag()
Decimal.min()
Decimal.min_mag()
Decimal.next_minus()
Decimal.next_plus()
Decimal.next_toward()
Decimal.normalize()
Decimal.number_class()
Decimal.quantize()
Decimal.radix()
Decimal.remainder_near()
Decimal.rotate()
Decimal.same_quantum()
Decimal.scaleb()
Decimal.shift()
Decimal.sqrt()
Decimal.to_eng_string()
Decimal.to_integral()
Decimal.to_integral_exact()
Decimal.to_integral_value()
- Logical operands
- Context objects
getcontext()
setcontext()
localcontext()
BasicContext
ExtendedContext
DefaultContext
Context
Context.clear_flags()
Context.clear_traps()
Context.copy()
Context.copy_decimal()
Context.create_decimal()
Context.create_decimal_from_float()
Context.Etiny()
Context.Etop()
Context.abs()
Context.add()
Context.canonical()
Context.compare()
Context.compare_signal()
Context.compare_total()
Context.compare_total_mag()
Context.copy_abs()
Context.copy_negate()
Context.copy_sign()
Context.divide()
Context.divide_int()
Context.divmod()
Context.exp()
Context.fma()
Context.is_canonical()
Context.is_finite()
Context.is_infinite()
Context.is_nan()
Context.is_normal()
Context.is_qnan()
Context.is_signed()
Context.is_snan()
Context.is_subnormal()
Context.is_zero()
Context.ln()
Context.log10()
Context.logb()
Context.logical_and()
Context.logical_invert()
Context.logical_or()
Context.logical_xor()
Context.max()
Context.max_mag()
Context.min()
Context.min_mag()
Context.minus()
Context.multiply()
Context.next_minus()
Context.next_plus()
Context.next_toward()
Context.normalize()
Context.number_class()
Context.plus()
Context.power()
Context.quantize()
Context.radix()
Context.remainder()
Context.remainder_near()
Context.rotate()
Context.same_quantum()
Context.scaleb()
Context.shift()
Context.sqrt()
Context.subtract()
Context.to_eng_string()
Context.to_integral_exact()
Context.to_sci_string()
- 常數
- Rounding modes
- Signals
- Floating Point Notes
- Working with threads
- Recipes
- Decimal FAQ
fractions
--- Rational numbersrandom
--- 生成偽隨機數statistics
--- 數學統計函式
- 函式編程模組
itertools
--- 建立產生高效率迴圈之疊代器的函式functools
--- Higher-order functions and operations on callable objectsoperator
--- 標準運算子替代函式lt()
le()
eq()
ne()
ge()
gt()
__lt__()
__le__()
__eq__()
__ne__()
__ge__()
__gt__()
not_()
__not__()
truth()
is_()
is_not()
abs()
__abs__()
add()
__add__()
and_()
__and__()
floordiv()
__floordiv__()
index()
__index__()
inv()
invert()
__inv__()
__invert__()
lshift()
__lshift__()
mod()
__mod__()
mul()
__mul__()
matmul()
__matmul__()
neg()
__neg__()
or_()
__or__()
pos()
__pos__()
pow()
__pow__()
rshift()
__rshift__()
sub()
__sub__()
truediv()
__truediv__()
xor()
__xor__()
concat()
__concat__()
contains()
__contains__()
countOf()
delitem()
__delitem__()
getitem()
__getitem__()
indexOf()
setitem()
__setitem__()
length_hint()
call()
__call__()
attrgetter()
itemgetter()
methodcaller()
- 運算子與函式間的對映
- 原地 (in-place) 運算子
- 檔案與目錄存取
pathlib
--- 物件導向檔案系統路徑- 基本用法
- 純路徑
PurePath
PurePosixPath
PureWindowsPath
- 通用屬性
- 運算子
- 對個別組成的存取
- 方法與屬性
PurePath.drive
PurePath.root
PurePath.anchor
PurePath.parents
PurePath.parent
PurePath.name
PurePath.suffix
PurePath.suffixes
PurePath.stem
PurePath.as_posix()
PurePath.as_uri()
PurePath.is_absolute()
PurePath.is_relative_to()
PurePath.is_reserved()
PurePath.joinpath()
PurePath.match()
PurePath.relative_to()
PurePath.with_name()
PurePath.with_stem()
PurePath.with_suffix()
PurePath.with_segments()
- Concrete paths
Path
PosixPath
WindowsPath
- Methods
Path.cwd()
Path.home()
Path.stat()
Path.chmod()
Path.exists()
Path.expanduser()
Path.glob()
Path.group()
Path.is_dir()
Path.is_file()
Path.is_junction()
Path.is_mount()
Path.is_symlink()
Path.is_socket()
Path.is_fifo()
Path.is_block_device()
Path.is_char_device()
Path.iterdir()
Path.walk()
Path.lchmod()
Path.lstat()
Path.mkdir()
Path.open()
Path.owner()
Path.read_bytes()
Path.read_text()
Path.readlink()
Path.rename()
Path.replace()
Path.absolute()
Path.resolve()
Path.rglob()
Path.rmdir()
Path.samefile()
Path.symlink_to()
Path.hardlink_to()
Path.touch()
Path.unlink()
Path.write_bytes()
Path.write_text()
- Correspondence to tools in the
os
module
os.path
--- 常見的路徑名操作abspath()
basename()
commonpath()
commonprefix()
dirname()
exists()
lexists()
expanduser()
expandvars()
getatime()
getmtime()
getctime()
getsize()
isabs()
isfile()
isdir()
isjunction()
islink()
ismount()
isdevdrive()
join()
normcase()
normpath()
realpath()
relpath()
samefile()
sameopenfile()
samestat()
split()
splitdrive()
splitroot()
splitext()
supports_unicode_filenames
fileinput
--- Iterate over lines from multiple input streamsstat
--- Interpretingstat()
resultsS_ISDIR()
S_ISCHR()
S_ISBLK()
S_ISREG()
S_ISFIFO()
S_ISLNK()
S_ISSOCK()
S_ISDOOR()
S_ISPORT()
S_ISWHT()
S_IMODE()
S_IFMT()
filemode()
ST_MODE
ST_INO
ST_DEV
ST_NLINK
ST_UID
ST_GID
ST_SIZE
ST_ATIME
ST_MTIME
ST_CTIME
S_IFSOCK
S_IFLNK
S_IFREG
S_IFBLK
S_IFDIR
S_IFCHR
S_IFIFO
S_IFDOOR
S_IFPORT
S_IFWHT
S_ISUID
S_ISGID
S_ISVTX
S_IRWXU
S_IRUSR
S_IWUSR
S_IXUSR
S_IRWXG
S_IRGRP
S_IWGRP
S_IXGRP
S_IRWXO
S_IROTH
S_IWOTH
S_IXOTH
S_ENFMT
S_IREAD
S_IWRITE
S_IEXEC
UF_NODUMP
UF_IMMUTABLE
UF_APPEND
UF_OPAQUE
UF_NOUNLINK
UF_COMPRESSED
UF_HIDDEN
SF_ARCHIVED
SF_IMMUTABLE
SF_APPEND
SF_NOUNLINK
SF_SNAPSHOT
FILE_ATTRIBUTE_ARCHIVE
FILE_ATTRIBUTE_COMPRESSED
FILE_ATTRIBUTE_DEVICE
FILE_ATTRIBUTE_DIRECTORY
FILE_ATTRIBUTE_ENCRYPTED
FILE_ATTRIBUTE_HIDDEN
FILE_ATTRIBUTE_INTEGRITY_STREAM
FILE_ATTRIBUTE_NORMAL
FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
FILE_ATTRIBUTE_NO_SCRUB_DATA
FILE_ATTRIBUTE_OFFLINE
FILE_ATTRIBUTE_READONLY
FILE_ATTRIBUTE_REPARSE_POINT
FILE_ATTRIBUTE_SPARSE_FILE
FILE_ATTRIBUTE_SYSTEM
FILE_ATTRIBUTE_TEMPORARY
FILE_ATTRIBUTE_VIRTUAL
IO_REPARSE_TAG_SYMLINK
IO_REPARSE_TAG_MOUNT_POINT
IO_REPARSE_TAG_APPEXECLINK
filecmp
--- File and Directory Comparisonscmp()
cmpfiles()
clear_cache()
- The
dircmp
classdircmp
dircmp.report()
dircmp.report_partial_closure()
dircmp.report_full_closure()
dircmp.left
dircmp.right
dircmp.left_list
dircmp.right_list
dircmp.common
dircmp.left_only
dircmp.right_only
dircmp.common_dirs
dircmp.common_files
dircmp.common_funny
dircmp.same_files
dircmp.diff_files
dircmp.funny_files
dircmp.subdirs
DEFAULT_IGNORES
tempfile
--- 生成臨時檔案和目錄glob
--- Unix 風格的路徑名稱模式擴展fnmatch
--- Unix filename pattern matchinglinecache
--- Random access to text linesshutil
--- High-level file operations
- Data Persistence
pickle
--- Python object serialization- Relationship to other Python modules
- Data stream format
- 模組介面
- What can be pickled and unpickled?
- Pickling Class Instances
- Custom Reduction for Types, Functions, and Other Objects
- Out-of-band Buffers
- Restricting Globals
- Performance
- 範例
copyreg
--- 註冊pickle
支援函式shelve
--- Python object persistencemarshal
--- 内部 Python 物件序列化dbm
--- Interfaces to Unix "databases"sqlite3
--- SQLite 資料庫的 DB-API 2.0 介面- Tutorial
- Reference
- Module functions
- Module constants
LEGACY_TRANSACTION_CONTROL
PARSE_COLNAMES
PARSE_DECLTYPES
SQLITE_OK
SQLITE_DENY
SQLITE_IGNORE
apilevel
paramstyle
sqlite_version
sqlite_version_info
threadsafety
version
version_info
SQLITE_DBCONFIG_DEFENSIVE
SQLITE_DBCONFIG_DQS_DDL
SQLITE_DBCONFIG_DQS_DML
SQLITE_DBCONFIG_ENABLE_FKEY
SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER
SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION
SQLITE_DBCONFIG_ENABLE_QPSG
SQLITE_DBCONFIG_ENABLE_TRIGGER
SQLITE_DBCONFIG_ENABLE_VIEW
SQLITE_DBCONFIG_LEGACY_ALTER_TABLE
SQLITE_DBCONFIG_LEGACY_FILE_FORMAT
SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE
SQLITE_DBCONFIG_RESET_DATABASE
SQLITE_DBCONFIG_TRIGGER_EQP
SQLITE_DBCONFIG_TRUSTED_SCHEMA
SQLITE_DBCONFIG_WRITABLE_SCHEMA
- Connection 物件
Connection
Connection.cursor()
Connection.blobopen()
Connection.commit()
Connection.rollback()
Connection.close()
Connection.execute()
Connection.executemany()
Connection.executescript()
Connection.create_function()
Connection.create_aggregate()
Connection.create_window_function()
Connection.create_collation()
Connection.interrupt()
Connection.set_authorizer()
Connection.set_progress_handler()
Connection.set_trace_callback()
Connection.enable_load_extension()
Connection.load_extension()
Connection.iterdump()
Connection.backup()
Connection.getlimit()
Connection.setlimit()
Connection.getconfig()
Connection.setconfig()
Connection.serialize()
Connection.deserialize()
Connection.autocommit
Connection.in_transaction
Connection.isolation_level
Connection.row_factory
Connection.text_factory
Connection.total_changes
- Cursor 物件
- Row 物件
- Blob 物件
- PrepareProtocol 物件
- 例外
- SQLite and Python types
- Default adapters and converters (deprecated)
- 命令列介面
- How-to guides
- How to use placeholders to bind values in SQL queries
- How to adapt custom Python types to SQLite values
- How to convert SQLite values to custom Python types
- Adapter and converter recipes
- How to use connection shortcut methods
- How to use the connection context manager
- How to work with SQLite URIs
- How to create and use row factories
- How to handle non-UTF-8 text encodings
- 解釋
- 資料壓縮與保存
zlib
--- 相容於 gzip 的壓縮gzip
--- gzip 檔案的支援bz2
--- Support for bzip2 compressionlzma
--- Compression using the LZMA algorithmzipfile
--- Work with ZIP archivesBadZipFile
BadZipfile
LargeZipFile
ZipInfo
is_zipfile()
ZIP_STORED
ZIP_DEFLATED
ZIP_BZIP2
ZIP_LZMA
- ZipFile 物件
- Path Objects
- PyZipFile 物件
- ZipInfo 物件
ZipInfo.from_file()
ZipInfo.is_dir()
ZipInfo.filename
ZipInfo.date_time
ZipInfo.compress_type
ZipInfo.comment
ZipInfo.extra
ZipInfo.create_system
ZipInfo.create_version
ZipInfo.extract_version
ZipInfo.reserved
ZipInfo.flag_bits
ZipInfo.volume
ZipInfo.internal_attr
ZipInfo.external_attr
ZipInfo.header_offset
ZipInfo.CRC
ZipInfo.compress_size
ZipInfo.file_size
- Command-Line Interface
- Decompression pitfalls
tarfile
--- Read and write tar archive filesopen()
is_tarfile()
TarError
ReadError
CompressionError
StreamError
ExtractError
HeaderError
FilterError
AbsolutePathError
OutsideDestinationError
SpecialFileError
AbsoluteLinkError
LinkOutsideDestinationError
ENCODING
REGTYPE
AREGTYPE
LNKTYPE
SYMTYPE
CHRTYPE
BLKTYPE
DIRTYPE
FIFOTYPE
CONTTYPE
GNUTYPE_LONGNAME
GNUTYPE_LONGLINK
GNUTYPE_SPARSE
USTAR_FORMAT
GNU_FORMAT
PAX_FORMAT
DEFAULT_FORMAT
- TarFile 物件
- TarInfo 物件
TarInfo
TarInfo.frombuf()
TarInfo.fromtarfile()
TarInfo.tobuf()
TarInfo.name
TarInfo.size
TarInfo.mtime
TarInfo.mode
TarInfo.type
TarInfo.linkname
TarInfo.uid
TarInfo.gid
TarInfo.uname
TarInfo.gname
TarInfo.pax_headers
TarInfo.replace()
TarInfo.isfile()
TarInfo.isreg()
TarInfo.isdir()
TarInfo.issym()
TarInfo.islnk()
TarInfo.ischr()
TarInfo.isblk()
TarInfo.isfifo()
TarInfo.isdev()
- Extraction filters
- Command-Line Interface
- 範例
- Supported tar formats
- Unicode issues
- 檔案格式
csv
--- CSV 檔案讀取及寫入configparser
--- Configuration file parser- Quick Start
- Supported Datatypes
- Fallback Values
- Supported INI File Structure
- Interpolation of values
- Mapping Protocol Access
- Customizing Parser Behaviour
- Legacy API Examples
- ConfigParser 物件
ConfigParser
ConfigParser.defaults()
ConfigParser.sections()
ConfigParser.add_section()
ConfigParser.has_section()
ConfigParser.options()
ConfigParser.has_option()
ConfigParser.read()
ConfigParser.read_file()
ConfigParser.read_string()
ConfigParser.read_dict()
ConfigParser.get()
ConfigParser.getint()
ConfigParser.getfloat()
ConfigParser.getboolean()
ConfigParser.items()
ConfigParser.set()
ConfigParser.write()
ConfigParser.remove_option()
ConfigParser.remove_section()
ConfigParser.optionxform()
MAX_INTERPOLATION_DEPTH
- RawConfigParser 物件
- 例外
tomllib
--- 剖析 TOML 檔案netrc
--- netrc 檔案處理plistlib
--- Generate and parse Apple.plist
files
- 加密服務
- 通用作業系統服務
os
--- 各種作業系統介面error
name
- File Names, Command Line Arguments, and Environment Variables
- Python UTF-8 Mode
- Process Parameters
ctermid()
environ
environb
fsencode()
fsdecode()
fspath()
PathLike
getenv()
getenvb()
get_exec_path()
getegid()
geteuid()
getgid()
getgrouplist()
getgroups()
getlogin()
getpgid()
getpgrp()
getpid()
getppid()
getpriority()
PRIO_PROCESS
PRIO_PGRP
PRIO_USER
PRIO_DARWIN_THREAD
PRIO_DARWIN_PROCESS
PRIO_DARWIN_BG
PRIO_DARWIN_NONUI
getresuid()
getresgid()
getuid()
initgroups()
putenv()
setegid()
seteuid()
setgid()
setgroups()
setns()
setpgrp()
setpgid()
setpriority()
setregid()
setresgid()
setresuid()
setreuid()
getsid()
setsid()
setuid()
strerror()
supports_bytes_environ
umask()
uname()
unsetenv()
unshare()
CLONE_FILES
CLONE_FS
CLONE_NEWCGROUP
CLONE_NEWIPC
CLONE_NEWNET
CLONE_NEWNS
CLONE_NEWPID
CLONE_NEWTIME
CLONE_NEWUSER
CLONE_NEWUTS
CLONE_SIGHAND
CLONE_SYSVSEM
CLONE_THREAD
CLONE_VM
- File Object Creation
- File Descriptor Operations
close()
closerange()
copy_file_range()
device_encoding()
dup()
dup2()
fchmod()
fchown()
fdatasync()
fpathconf()
fstat()
fstatvfs()
fsync()
ftruncate()
get_blocking()
isatty()
lockf()
F_LOCK
F_TLOCK
F_ULOCK
F_TEST
login_tty()
lseek()
SEEK_SET
SEEK_CUR
SEEK_END
SEEK_HOLE
SEEK_DATA
open()
O_RDONLY
O_WRONLY
O_RDWR
O_APPEND
O_CREAT
O_EXCL
O_TRUNC
O_DSYNC
O_RSYNC
O_SYNC
O_NDELAY
O_NONBLOCK
O_NOCTTY
O_CLOEXEC
O_BINARY
O_NOINHERIT
O_SHORT_LIVED
O_TEMPORARY
O_RANDOM
O_SEQUENTIAL
O_TEXT
O_EVTONLY
O_FSYNC
O_SYMLINK
O_NOFOLLOW_ANY
O_ASYNC
O_DIRECT
O_DIRECTORY
O_NOFOLLOW
O_NOATIME
O_PATH
O_TMPFILE
O_SHLOCK
O_EXLOCK
openpty()
pipe()
pipe2()
posix_fallocate()
posix_fadvise()
POSIX_FADV_NORMAL
POSIX_FADV_SEQUENTIAL
POSIX_FADV_RANDOM
POSIX_FADV_NOREUSE
POSIX_FADV_WILLNEED
POSIX_FADV_DONTNEED
pread()
preadv()
RWF_NOWAIT
RWF_HIPRI
pwrite()
pwritev()
RWF_DSYNC
RWF_SYNC
RWF_APPEND
read()
sendfile()
SF_NODISKIO
SF_MNOWAIT
SF_SYNC
SF_NOCACHE
set_blocking()
splice()
SPLICE_F_MOVE
SPLICE_F_NONBLOCK
SPLICE_F_MORE
readv()
tcgetpgrp()
tcsetpgrp()
ttyname()
write()
writev()
- Querying the size of a terminal
- Inheritance of File Descriptors
- Files and Directories
access()
F_OK
R_OK
W_OK
X_OK
chdir()
chflags()
chmod()
chown()
chroot()
fchdir()
getcwd()
getcwdb()
lchflags()
lchmod()
lchown()
link()
listdir()
listdrives()
listmounts()
listvolumes()
lstat()
mkdir()
makedirs()
mkfifo()
mknod()
major()
minor()
makedev()
pathconf()
pathconf_names
readlink()
remove()
removedirs()
rename()
renames()
replace()
rmdir()
scandir()
DirEntry
stat()
stat_result
stat_result.st_mode
stat_result.st_ino
stat_result.st_dev
stat_result.st_nlink
stat_result.st_uid
stat_result.st_gid
stat_result.st_size
stat_result.st_atime
stat_result.st_mtime
stat_result.st_ctime
stat_result.st_atime_ns
stat_result.st_mtime_ns
stat_result.st_ctime_ns
stat_result.st_birthtime
stat_result.st_birthtime_ns
stat_result.st_blocks
stat_result.st_blksize
stat_result.st_rdev
stat_result.st_flags
stat_result.st_gen
stat_result.st_fstype
stat_result.st_rsize
stat_result.st_creator
stat_result.st_type
stat_result.st_file_attributes
stat_result.st_reparse_tag
statvfs()
supports_dir_fd
supports_effective_ids
supports_fd
supports_follow_symlinks
symlink()
sync()
truncate()
unlink()
utime()
walk()
fwalk()
memfd_create()
MFD_CLOEXEC
MFD_ALLOW_SEALING
MFD_HUGETLB
MFD_HUGE_SHIFT
MFD_HUGE_MASK
MFD_HUGE_64KB
MFD_HUGE_512KB
MFD_HUGE_1MB
MFD_HUGE_2MB
MFD_HUGE_8MB
MFD_HUGE_16MB
MFD_HUGE_32MB
MFD_HUGE_256MB
MFD_HUGE_512MB
MFD_HUGE_1GB
MFD_HUGE_2GB
MFD_HUGE_16GB
eventfd()
eventfd_read()
eventfd_write()
EFD_CLOEXEC
EFD_NONBLOCK
EFD_SEMAPHORE
- Linux extended attributes
- Process Management
abort()
add_dll_directory()
execl()
execle()
execlp()
execlpe()
execv()
execve()
execvp()
execvpe()
_exit()
EX_OK
EX_USAGE
EX_DATAERR
EX_NOINPUT
EX_NOUSER
EX_NOHOST
EX_UNAVAILABLE
EX_SOFTWARE
EX_OSERR
EX_OSFILE
EX_CANTCREAT
EX_IOERR
EX_TEMPFAIL
EX_PROTOCOL
EX_NOPERM
EX_CONFIG
EX_NOTFOUND
fork()
forkpty()
kill()
killpg()
nice()
pidfd_open()
PIDFD_NONBLOCK
plock()
popen()
posix_spawn()
POSIX_SPAWN_OPEN
POSIX_SPAWN_CLOSE
POSIX_SPAWN_DUP2
posix_spawnp()
register_at_fork()
spawnl()
spawnle()
spawnlp()
spawnlpe()
spawnv()
spawnve()
spawnvp()
spawnvpe()
P_NOWAIT
P_NOWAITO
P_WAIT
P_DETACH
P_OVERLAY
startfile()
system()
times()
wait()
waitid()
waitpid()
wait3()
wait4()
P_PID
P_PGID
P_ALL
P_PIDFD
WCONTINUED
WEXITED
WSTOPPED
WUNTRACED
WNOHANG
WNOWAIT
CLD_EXITED
CLD_KILLED
CLD_DUMPED
CLD_TRAPPED
CLD_STOPPED
CLD_CONTINUED
waitstatus_to_exitcode()
WCOREDUMP()
WIFCONTINUED()
WIFSTOPPED()
WIFSIGNALED()
WIFEXITED()
WEXITSTATUS()
WSTOPSIG()
WTERMSIG()
- Interface to the scheduler
SCHED_OTHER
SCHED_BATCH
SCHED_IDLE
SCHED_SPORADIC
SCHED_FIFO
SCHED_RR
SCHED_RESET_ON_FORK
sched_param
sched_get_priority_min()
sched_get_priority_max()
sched_setscheduler()
sched_getscheduler()
sched_setparam()
sched_getparam()
sched_rr_get_interval()
sched_yield()
sched_setaffinity()
sched_getaffinity()
- Miscellaneous System Information
- Random numbers
io
— 處理資料串流的核心工具time
--- Time access and conversions- 函式
asctime()
pthread_getcpuclockid()
clock_getres()
clock_gettime()
clock_gettime_ns()
clock_settime()
clock_settime_ns()
ctime()
get_clock_info()
gmtime()
localtime()
mktime()
monotonic()
monotonic_ns()
perf_counter()
perf_counter_ns()
process_time()
process_time_ns()
sleep()
strftime()
strptime()
struct_time
time()
time_ns()
thread_time()
thread_time_ns()
tzset()
- Clock ID Constants
- Timezone Constants
- 函式
argparse
--- Parser for command-line options, arguments and sub-commands- Core Functionality
- Quick Links for add_argument()
- 範例
- ArgumentParser 物件
- The add_argument() method
- The parse_args() method
- Other utilities
- Upgrading optparse code
- Exceptions
getopt
--- C-style parser for command line optionslogging
--- Python 的日誌記錄工具- Logger Objects
Logger
Logger.propagate
Logger.setLevel()
Logger.isEnabledFor()
Logger.getEffectiveLevel()
Logger.getChild()
Logger.getChildren()
Logger.debug()
Logger.info()
Logger.warning()
Logger.error()
Logger.critical()
Logger.log()
Logger.exception()
Logger.addFilter()
Logger.removeFilter()
Logger.filter()
Logger.addHandler()
Logger.removeHandler()
Logger.findCaller()
Logger.handle()
Logger.makeRecord()
Logger.hasHandlers()
- Logging Levels
- Handler Objects
- Formatter Objects
- Filter Objects
- LogRecord 物件
- LogRecord attributes
- LoggerAdapter 物件
- Thread Safety
- Module-Level Functions
- Module-Level Attributes
- Integration with the warnings module
- Logger Objects
logging.config
--- Logging configurationlogging.handlers
--- Logging handlersgetpass
--- 可攜式密碼輸入工具curses
--- Terminal handling for character-cell displays- 函式
error
baudrate()
beep()
can_change_color()
cbreak()
color_content()
color_pair()
curs_set()
def_prog_mode()
def_shell_mode()
delay_output()
doupdate()
echo()
endwin()
erasechar()
filter()
flash()
flushinp()
getmouse()
getsyx()
getwin()
has_colors()
has_extended_color_support()
has_ic()
has_il()
has_key()
halfdelay()
init_color()
init_pair()
initscr()
is_term_resized()
isendwin()
keyname()
killchar()
longname()
meta()
mouseinterval()
mousemask()
napms()
newpad()
newwin()
nl()
nocbreak()
noecho()
nonl()
noqiflush()
noraw()
pair_content()
pair_number()
putp()
qiflush()
raw()
reset_prog_mode()
reset_shell_mode()
resetty()
resize_term()
resizeterm()
savetty()
get_escdelay()
set_escdelay()
get_tabsize()
set_tabsize()
setsyx()
setupterm()
start_color()
termattrs()
termname()
tigetflag()
tigetnum()
tigetstr()
tparm()
typeahead()
unctrl()
ungetch()
update_lines_cols()
unget_wch()
ungetmouse()
use_env()
use_default_colors()
wrapper()
- Window Objects
window.addch()
window.addnstr()
window.addstr()
window.attroff()
window.attron()
window.attrset()
window.bkgd()
window.bkgdset()
window.border()
window.box()
window.chgat()
window.clear()
window.clearok()
window.clrtobot()
window.clrtoeol()
window.cursyncup()
window.delch()
window.deleteln()
window.derwin()
window.echochar()
window.enclose()
window.encoding
window.erase()
window.getbegyx()
window.getbkgd()
window.getch()
window.get_wch()
window.getkey()
window.getmaxyx()
window.getparyx()
window.getstr()
window.getyx()
window.hline()
window.idcok()
window.idlok()
window.immedok()
window.inch()
window.insch()
window.insdelln()
window.insertln()
window.insnstr()
window.insstr()
window.instr()
window.is_linetouched()
window.is_wintouched()
window.keypad()
window.leaveok()
window.move()
window.mvderwin()
window.mvwin()
window.nodelay()
window.notimeout()
window.noutrefresh()
window.overlay()
window.overwrite()
window.putwin()
window.redrawln()
window.redrawwin()
window.refresh()
window.resize()
window.scroll()
window.scrollok()
window.setscrreg()
window.standend()
window.standout()
window.subpad()
window.subwin()
window.syncdown()
window.syncok()
window.syncup()
window.timeout()
window.touchline()
window.touchwin()
window.untouchwin()
window.vline()
- Constants
ERR
OK
version
__version__
ncurses_version
COLORS
COLOR_PAIRS
COLS
LINES
A_ALTCHARSET
A_BLINK
A_BOLD
A_DIM
A_INVIS
A_ITALIC
A_NORMAL
A_PROTECT
A_REVERSE
A_STANDOUT
A_UNDERLINE
A_HORIZONTAL
A_LEFT
A_LOW
A_RIGHT
A_TOP
A_VERTICAL
A_ATTRIBUTES
A_CHARTEXT
A_COLOR
KEY_MIN
KEY_BREAK
KEY_DOWN
KEY_UP
KEY_LEFT
KEY_RIGHT
KEY_HOME
KEY_BACKSPACE
KEY_F0
KEY_Fn
KEY_DL
KEY_IL
KEY_DC
KEY_IC
KEY_EIC
KEY_CLEAR
KEY_EOS
KEY_EOL
KEY_SF
KEY_SR
KEY_NPAGE
KEY_PPAGE
KEY_STAB
KEY_CTAB
KEY_CATAB
KEY_ENTER
KEY_SRESET
KEY_RESET
KEY_PRINT
KEY_LL
KEY_A1
KEY_A3
KEY_B2
KEY_C1
KEY_C3
KEY_BTAB
KEY_BEG
KEY_CANCEL
KEY_CLOSE
KEY_COMMAND
KEY_COPY
KEY_CREATE
KEY_END
KEY_EXIT
KEY_FIND
KEY_HELP
KEY_MARK
KEY_MESSAGE
KEY_MOVE
KEY_NEXT
KEY_OPEN
KEY_OPTIONS
KEY_PREVIOUS
KEY_REDO
KEY_REFERENCE
KEY_REFRESH
KEY_REPLACE
KEY_RESTART
KEY_RESUME
KEY_SAVE
KEY_SBEG
KEY_SCANCEL
KEY_SCOMMAND
KEY_SCOPY
KEY_SCREATE
KEY_SDC
KEY_SDL
KEY_SELECT
KEY_SEND
KEY_SEOL
KEY_SEXIT
KEY_SFIND
KEY_SHELP
KEY_SHOME
KEY_SIC
KEY_SLEFT
KEY_SMESSAGE
KEY_SMOVE
KEY_SNEXT
KEY_SOPTIONS
KEY_SPREVIOUS
KEY_SPRINT
KEY_SREDO
KEY_SREPLACE
KEY_SRIGHT
KEY_SRSUME
KEY_SSAVE
KEY_SSUSPEND
KEY_SUNDO
KEY_SUSPEND
KEY_UNDO
KEY_MOUSE
KEY_RESIZE
KEY_MAX
ACS_BBSS
ACS_BLOCK
ACS_BOARD
ACS_BSBS
ACS_BSSB
ACS_BSSS
ACS_BTEE
ACS_BULLET
ACS_CKBOARD
ACS_DARROW
ACS_DEGREE
ACS_DIAMOND
ACS_GEQUAL
ACS_HLINE
ACS_LANTERN
ACS_LARROW
ACS_LEQUAL
ACS_LLCORNER
ACS_LRCORNER
ACS_LTEE
ACS_NEQUAL
ACS_PI
ACS_PLMINUS
ACS_PLUS
ACS_RARROW
ACS_RTEE
ACS_S1
ACS_S3
ACS_S7
ACS_S9
ACS_SBBS
ACS_SBSB
ACS_SBSS
ACS_SSBB
ACS_SSBS
ACS_SSSB
ACS_SSSS
ACS_STERLING
ACS_TTEE
ACS_UARROW
ACS_ULCORNER
ACS_URCORNER
ACS_VLINE
BUTTONn_PRESSED
BUTTONn_RELEASED
BUTTONn_CLICKED
BUTTONn_DOUBLE_CLICKED
BUTTONn_TRIPLE_CLICKED
BUTTON_SHIFT
BUTTON_CTRL
BUTTON_ALT
COLOR_BLACK
COLOR_BLUE
COLOR_CYAN
COLOR_GREEN
COLOR_MAGENTA
COLOR_RED
COLOR_WHITE
COLOR_YELLOW
- 函式
curses.textpad
--- Text input widget for curses programscurses.ascii
--- ASCII 字元的工具程式NUL
SOH
STX
ETX
EOT
ENQ
ACK
BEL
BS
TAB
HT
LF
NL
VT
FF
CR
SO
SI
DLE
DC1
DC2
DC3
DC4
NAK
SYN
ETB
CAN
EM
SUB
ESC
FS
GS
RS
US
SP
DEL
isalnum()
isalpha()
isascii()
isblank()
iscntrl()
isdigit()
isgraph()
islower()
isprint()
ispunct()
isspace()
isupper()
isxdigit()
isctrl()
ismeta()
ascii()
ctrl()
alt()
unctrl()
controlnames
curses.panel
--- A panel stack extension for cursesplatform
--- 獲取底層平臺的標識資料errno
--- Standard errno system symbolserrorcode
EPERM
ENOENT
ESRCH
EINTR
EIO
ENXIO
E2BIG
ENOEXEC
EBADF
ECHILD
EAGAIN
ENOMEM
EACCES
EFAULT
ENOTBLK
EBUSY
EEXIST
EXDEV
ENODEV
ENOTDIR
EISDIR
EINVAL
ENFILE
EMFILE
ENOTTY
ETXTBSY
EFBIG
ENOSPC
ESPIPE
EROFS
EMLINK
EPIPE
EDOM
ERANGE
EDEADLK
ENAMETOOLONG
ENOLCK
ENOSYS
ENOTEMPTY
ELOOP
EWOULDBLOCK
ENOMSG
EIDRM
ECHRNG
EL2NSYNC
EL3HLT
EL3RST
ELNRNG
EUNATCH
ENOCSI
EL2HLT
EBADE
EBADR
EXFULL
ENOANO
EBADRQC
EBADSLT
EDEADLOCK
EBFONT
ENOSTR
ENODATA
ETIME
ENOSR
ENONET
ENOPKG
EREMOTE
ENOLINK
EADV
ESRMNT
ECOMM
EPROTO
EMULTIHOP
EDOTDOT
EBADMSG
EOVERFLOW
ENOTUNIQ
EBADFD
EREMCHG
ELIBACC
ELIBBAD
ELIBSCN
ELIBMAX
ELIBEXEC
EILSEQ
ERESTART
ESTRPIPE
EUSERS
ENOTSOCK
EDESTADDRREQ
EMSGSIZE
EPROTOTYPE
ENOPROTOOPT
EPROTONOSUPPORT
ESOCKTNOSUPPORT
EOPNOTSUPP
ENOTSUP
EPFNOSUPPORT
EAFNOSUPPORT
EADDRINUSE
EADDRNOTAVAIL
ENETDOWN
ENETUNREACH
ENETRESET
ECONNABORTED
ECONNRESET
ENOBUFS
EISCONN
ENOTCONN
ESHUTDOWN
ETOOMANYREFS
ETIMEDOUT
ECONNREFUSED
EHOSTDOWN
EHOSTUNREACH
EALREADY
EINPROGRESS
ESTALE
EUCLEAN
ENOTNAM
ENAVAIL
EISNAM
EREMOTEIO
EDQUOT
EQFULL
ENOTCAPABLE
ECANCELED
EOWNERDEAD
ENOTRECOVERABLE
ctypes
--- A foreign function library for Python- ctypes tutorial
- Loading dynamic link libraries
- Accessing functions from loaded dlls
- Calling functions
- Fundamental data types
- Calling functions, continued
- Calling variadic functions
- Calling functions with your own custom data types
- Specifying the required argument types (function prototypes)
- Return types
- Passing pointers (or: passing parameters by reference)
- Structures and unions
- Structure/union alignment and byte order
- Bit fields in structures and unions
- Arrays
- Pointers
- Type conversions
- Incomplete Types
- Callback functions
- Accessing values exported from dlls
- Surprises
- Variable-sized data types
- ctypes reference
- Finding shared libraries
- Loading shared libraries
- Foreign functions
- Function prototypes
- Utility functions
addressof()
alignment()
byref()
cast()
create_string_buffer()
create_unicode_buffer()
DllCanUnloadNow()
DllGetClassObject()
find_library()
find_msvcrt()
FormatError()
GetLastError()
get_errno()
get_last_error()
memmove()
memset()
POINTER()
pointer()
resize()
set_errno()
set_last_error()
sizeof()
string_at()
WinError()
wstring_at()
- Data types
- Fundamental data types
- Structured data types
- Arrays and pointers
- ctypes tutorial
- 並行執行 (Concurrent Execution)
threading
--- Thread-based parallelismactive_count()
current_thread()
excepthook()
__excepthook__
get_ident()
get_native_id()
enumerate()
main_thread()
settrace()
settrace_all_threads()
gettrace()
setprofile()
setprofile_all_threads()
getprofile()
stack_size()
TIMEOUT_MAX
- Thread-Local Data
- Thread Objects
- Lock Objects
- RLock 物件
- Condition Objects
- Semaphore Objects
- Event Objects
- Timer Objects
- Barrier Objects
- Using locks, conditions, and semaphores in the
with
statement
multiprocessing
--- Process-based parallelism- 簡介
- Reference
Process
與例外- Pipes and Queues
- Miscellaneous
- Connection Objects
- Synchronization primitives
- Shared
ctypes
Objects - Managers
- Proxy Objects
- Process Pools
- Listeners and Clients
- Authentication keys
- Logging
- The
multiprocessing.dummy
module
- Programming guidelines
- 範例
multiprocessing.shared_memory
--- 對於共享記憶體的跨行程直接存取concurrent
套件concurrent.futures
-- 啟動平行任務subprocess
--- Subprocess management- Using the
subprocess
Module - Security Considerations
- Popen Objects
- Windows Popen Helpers
STARTUPINFO
- Windows Constants
STD_INPUT_HANDLE
STD_OUTPUT_HANDLE
STD_ERROR_HANDLE
SW_HIDE
STARTF_USESTDHANDLES
STARTF_USESHOWWINDOW
CREATE_NEW_CONSOLE
CREATE_NEW_PROCESS_GROUP
ABOVE_NORMAL_PRIORITY_CLASS
BELOW_NORMAL_PRIORITY_CLASS
HIGH_PRIORITY_CLASS
IDLE_PRIORITY_CLASS
NORMAL_PRIORITY_CLASS
REALTIME_PRIORITY_CLASS
CREATE_NO_WINDOW
DETACHED_PROCESS
CREATE_DEFAULT_ERROR_MODE
CREATE_BREAKAWAY_FROM_JOB
- Older high-level API
- Replacing Older Functions with the
subprocess
Module - Legacy Shell Invocation Functions
- 註解
- Using the
sched
--- Event schedulerqueue
--- 同步佇列 (queue) class(類別)contextvars
--- Context Variables_thread
--- Low-level threading API
- Networking and Interprocess Communication
asyncio
--- 非同步 I/O- Runners (執行器)
- Coroutines and Tasks
- 串流
- 同步化原始物件 (Synchronization Primitives)
- 子行程
- 建立子行程
- 常數
- Interacting with Subprocesses
asyncio.subprocess.Process
asyncio.subprocess.Process.wait()
asyncio.subprocess.Process.communicate()
asyncio.subprocess.Process.send_signal()
asyncio.subprocess.Process.terminate()
asyncio.subprocess.Process.kill()
asyncio.subprocess.Process.stdin
asyncio.subprocess.Process.stdout
asyncio.subprocess.Process.stderr
asyncio.subprocess.Process.pid
asyncio.subprocess.Process.returncode
- 子行程與線程
- 範例
- 佇列 (Queues)
- 例外
- Event Loop
get_running_loop()
get_event_loop()
set_event_loop()
new_event_loop()
- Event Loop Methods
- Running and stopping the loop
- Scheduling callbacks
- Scheduling delayed callbacks
- Creating Futures and Tasks
- Opening network connections
- Creating network servers
- Transferring files
- TLS Upgrade
- Watching file descriptors
- Working with socket objects directly
- DNS
- Working with pipes
- Unix signals
- Executing code in thread or process pools
- Error Handling API
- Enabling debug mode
- Running Subprocesses
- Callback Handles
- Server Objects
- Event Loop Implementations
- 範例
- Futures
- Transports and Protocols
- Policies
- Getting and Setting the Policy
- Policy Objects
- Process Watchers
- Custom Policies
- 平臺支援
- Extending
- 高階 API 索引
- 低階 API 索引
- 使用 asyncio 開發
socket
--- Low-level networking interface- Socket 系列家族
- 模組內容
- 例外
- 常數
AF_UNIX
AF_INET
AF_INET6
AF_UNSPEC
SOCK_STREAM
SOCK_DGRAM
SOCK_RAW
SOCK_RDM
SOCK_SEQPACKET
SOCK_CLOEXEC
SOCK_NONBLOCK
SOMAXCONN
AF_CAN
PF_CAN
CAN_BCM
CAN_RAW_FD_FRAMES
CAN_RAW_JOIN_FILTERS
CAN_ISOTP
CAN_J1939
AF_DIVERT
PF_DIVERT
AF_PACKET
PF_PACKET
ETH_P_ALL
AF_RDS
PF_RDS
SOL_RDS
SIO_RCVALL
SIO_KEEPALIVE_VALS
SIO_LOOPBACK_FAST_PATH
AF_ALG
SOL_ALG
AF_VSOCK
IOCTL_VM_SOCKETS_GET_LOCAL_CID
AF_LINK
has_ipv6
BDADDR_ANY
BDADDR_LOCAL
HCI_FILTER
HCI_TIME_STAMP
HCI_DATA_DIR
AF_QIPCRTR
SCM_CREDS2
LOCAL_CREDS
LOCAL_CREDS_PERSISTENT
SO_INCOMING_CPU
AF_HYPERV
HV_PROTOCOL_RAW
HVSOCKET_CONNECT_TIMEOUT
HVSOCKET_CONNECT_TIMEOUT_MAX
HVSOCKET_CONNECTED_SUSPEND
HVSOCKET_ADDRESS_FLAG_PASSTHRU
HV_GUID_ZERO
HV_GUID_WILDCARD
HV_GUID_BROADCAST
HV_GUID_CHILDREN
HV_GUID_LOOPBACK
HV_GUID_PARENT
ETHERTYPE_ARP
ETHERTYPE_IP
ETHERTYPE_IPV6
ETHERTYPE_VLAN
- 函式
- 建立 sockets
- 其他函式
close()
getaddrinfo()
getfqdn()
gethostbyname()
gethostbyname_ex()
gethostname()
gethostbyaddr()
getnameinfo()
getprotobyname()
getservbyname()
getservbyport()
ntohl()
ntohs()
htonl()
htons()
inet_aton()
inet_ntoa()
inet_pton()
inet_ntop()
CMSG_LEN()
CMSG_SPACE()
getdefaulttimeout()
setdefaulttimeout()
sethostname()
if_nameindex()
if_nametoindex()
if_indextoname()
send_fds()
recv_fds()
- Socket 物件
socket.accept()
socket.bind()
socket.close()
socket.connect()
socket.connect_ex()
socket.detach()
socket.dup()
socket.fileno()
socket.get_inheritable()
socket.getpeername()
socket.getsockname()
socket.getsockopt()
socket.getblocking()
socket.gettimeout()
socket.ioctl()
socket.listen()
socket.makefile()
socket.recv()
socket.recvfrom()
socket.recvmsg()
socket.recvmsg_into()
socket.recvfrom_into()
socket.recv_into()
socket.send()
socket.sendall()
socket.sendto()
socket.sendmsg()
socket.sendmsg_afalg()
socket.sendfile()
socket.set_inheritable()
socket.setblocking()
socket.settimeout()
socket.setsockopt()
socket.shutdown()
socket.share()
socket.family
socket.type
socket.proto
- Notes on socket timeouts
- 範例
ssl
--- socket 物件的 TLS/SSL 包裝器- 函式、常數與例外
- Socket 建立
- 語境建立
- 例外
- 隨機產生
- 認證處理
- 常數
CERT_NONE
CERT_OPTIONAL
CERT_REQUIRED
VerifyMode
VERIFY_DEFAULT
VERIFY_CRL_CHECK_LEAF
VERIFY_CRL_CHECK_CHAIN
VERIFY_X509_STRICT
VERIFY_ALLOW_PROXY_CERTS
VERIFY_X509_TRUSTED_FIRST
VERIFY_X509_PARTIAL_CHAIN
VerifyFlags
PROTOCOL_TLS
PROTOCOL_TLS_CLIENT
PROTOCOL_TLS_SERVER
PROTOCOL_SSLv23
PROTOCOL_SSLv3
PROTOCOL_TLSv1
PROTOCOL_TLSv1_1
PROTOCOL_TLSv1_2
OP_ALL
OP_NO_SSLv2
OP_NO_SSLv3
OP_NO_TLSv1
OP_NO_TLSv1_1
OP_NO_TLSv1_2
OP_NO_TLSv1_3
OP_NO_RENEGOTIATION
OP_CIPHER_SERVER_PREFERENCE
OP_SINGLE_DH_USE
OP_SINGLE_ECDH_USE
OP_ENABLE_MIDDLEBOX_COMPAT
OP_NO_COMPRESSION
Options
OP_NO_TICKET
OP_IGNORE_UNEXPECTED_EOF
OP_ENABLE_KTLS
OP_LEGACY_SERVER_CONNECT
HAS_ALPN
HAS_NEVER_CHECK_COMMON_NAME
HAS_ECDH
HAS_SNI
HAS_NPN
HAS_SSLv2
HAS_SSLv3
HAS_TLSv1
HAS_TLSv1_1
HAS_TLSv1_2
HAS_TLSv1_3
CHANNEL_BINDING_TYPES
OPENSSL_VERSION
OPENSSL_VERSION_INFO
OPENSSL_VERSION_NUMBER
ALERT_DESCRIPTION_HANDSHAKE_FAILURE
ALERT_DESCRIPTION_INTERNAL_ERROR
AlertDescription
Purpose.SERVER_AUTH
Purpose.CLIENT_AUTH
SSLErrorNumber
TLSVersion
- SSL Sockets
SSLSocket
SSLSocket.read()
SSLSocket.write()
SSLSocket.do_handshake()
SSLSocket.getpeercert()
SSLSocket.cipher()
SSLSocket.shared_ciphers()
SSLSocket.compression()
SSLSocket.get_channel_binding()
SSLSocket.selected_alpn_protocol()
SSLSocket.selected_npn_protocol()
SSLSocket.unwrap()
SSLSocket.verify_client_post_handshake()
SSLSocket.version()
SSLSocket.pending()
SSLSocket.context
SSLSocket.server_side
SSLSocket.server_hostname
SSLSocket.session
SSLSocket.session_reused
- SSL Contexts
SSLContext
SSLContext.cert_store_stats()
SSLContext.load_cert_chain()
SSLContext.load_default_certs()
SSLContext.load_verify_locations()
SSLContext.get_ca_certs()
SSLContext.get_ciphers()
SSLContext.set_default_verify_paths()
SSLContext.set_ciphers()
SSLContext.set_alpn_protocols()
SSLContext.set_npn_protocols()
SSLContext.sni_callback
SSLContext.set_servername_callback
SSLContext.load_dh_params()
SSLContext.set_ecdh_curve()
SSLContext.wrap_socket()
SSLContext.sslsocket_class
SSLContext.wrap_bio()
SSLContext.sslobject_class
SSLContext.session_stats()
SSLContext.check_hostname
SSLContext.keylog_filename
SSLContext.maximum_version
SSLContext.minimum_version
SSLContext.num_tickets
SSLContext.options
SSLContext.post_handshake_auth
SSLContext.protocol
SSLContext.hostname_checks_common_name
SSLContext.security_level
SSLContext.verify_flags
SSLContext.verify_mode
- Certificates
- 範例
- Notes on non-blocking sockets
- Memory BIO Support
- SSL session
- Security considerations
- TLS 1.3
- 函式、常數與例外
select
--- Waiting for I/O completionselectors
--- High-level I/O multiplexingsignal
--- Set handlers for asynchronous events- General rules
- 模組內容
Signals
Handlers
Sigmasks
SIG_DFL
SIG_IGN
SIGABRT
SIGALRM
SIGBREAK
SIGBUS
SIGCHLD
SIGCLD
SIGCONT
SIGFPE
SIGHUP
SIGILL
SIGINT
SIGKILL
SIGPIPE
SIGSEGV
SIGSTKFLT
SIGTERM
SIGUSR1
SIGUSR2
SIGWINCH
CTRL_C_EVENT
CTRL_BREAK_EVENT
NSIG
ITIMER_REAL
ITIMER_VIRTUAL
ITIMER_PROF
SIG_BLOCK
SIG_UNBLOCK
SIG_SETMASK
ItimerError
alarm()
getsignal()
strsignal()
valid_signals()
pause()
raise_signal()
pidfd_send_signal()
pthread_kill()
pthread_sigmask()
setitimer()
getitimer()
set_wakeup_fd()
siginterrupt()
signal()
sigpending()
sigwait()
sigwaitinfo()
sigtimedwait()
- 範例
- Note on SIGPIPE
- Note on Signal Handlers and Exceptions
mmap
--- Memory-mapped file supportmmap
- MADV_* Constants
MADV_NORMAL
MADV_RANDOM
MADV_SEQUENTIAL
MADV_WILLNEED
MADV_DONTNEED
MADV_REMOVE
MADV_DONTFORK
MADV_DOFORK
MADV_HWPOISON
MADV_MERGEABLE
MADV_UNMERGEABLE
MADV_SOFT_OFFLINE
MADV_HUGEPAGE
MADV_NOHUGEPAGE
MADV_DONTDUMP
MADV_DODUMP
MADV_FREE
MADV_NOSYNC
MADV_AUTOSYNC
MADV_NOCORE
MADV_CORE
MADV_PROTECT
MADV_FREE_REUSABLE
MADV_FREE_REUSE
- MAP_* 常數
- 網際網路資料處理
email
--- An email and MIME handling packageemail.message
: Representing an email messageEmailMessage
EmailMessage.as_string()
EmailMessage.__str__()
EmailMessage.as_bytes()
EmailMessage.__bytes__()
EmailMessage.is_multipart()
EmailMessage.set_unixfrom()
EmailMessage.get_unixfrom()
EmailMessage.__len__()
EmailMessage.__contains__()
EmailMessage.__getitem__()
EmailMessage.__setitem__()
EmailMessage.__delitem__()
EmailMessage.keys()
EmailMessage.values()
EmailMessage.items()
EmailMessage.get()
EmailMessage.get_all()
EmailMessage.add_header()
EmailMessage.replace_header()
EmailMessage.get_content_type()
EmailMessage.get_content_maintype()
EmailMessage.get_content_subtype()
EmailMessage.get_default_type()
EmailMessage.set_default_type()
EmailMessage.set_param()
EmailMessage.del_param()
EmailMessage.get_filename()
EmailMessage.get_boundary()
EmailMessage.set_boundary()
EmailMessage.get_content_charset()
EmailMessage.get_charsets()
EmailMessage.is_attachment()
EmailMessage.get_content_disposition()
EmailMessage.walk()
EmailMessage.get_body()
EmailMessage.iter_attachments()
EmailMessage.iter_parts()
EmailMessage.get_content()
EmailMessage.set_content()
EmailMessage.make_related()
EmailMessage.make_alternative()
EmailMessage.make_mixed()
EmailMessage.add_related()
EmailMessage.add_alternative()
EmailMessage.add_attachment()
EmailMessage.clear()
EmailMessage.clear_content()
EmailMessage.preamble
EmailMessage.epilogue
EmailMessage.defects
MIMEPart
email.parser
: Parsing email messagesemail.generator
: Generating MIME documentsemail.policy
: Policy ObjectsPolicy
Policy.max_line_length
Policy.linesep
Policy.cte_type
Policy.raise_on_defect
Policy.mangle_from_
Policy.message_factory
Policy.clone()
Policy.handle_defect()
Policy.register_defect()
Policy.header_max_count()
Policy.header_source_parse()
Policy.header_store_parse()
Policy.header_fetch_parse()
Policy.fold()
Policy.fold_binary()
EmailPolicy
default
SMTP
SMTPUTF8
HTTP
strict
Compat32
compat32
email.errors
: Exception and Defect classesemail.headerregistry
: Custom Header Objectsemail.contentmanager
: Managing MIME Contentemail
: Examplesemail.message.Message
: Representing an email message using thecompat32
APIMessage
Message.as_string()
Message.__str__()
Message.as_bytes()
Message.__bytes__()
Message.is_multipart()
Message.set_unixfrom()
Message.get_unixfrom()
Message.attach()
Message.get_payload()
Message.set_payload()
Message.set_charset()
Message.get_charset()
Message.__len__()
Message.__contains__()
Message.__getitem__()
Message.__setitem__()
Message.__delitem__()
Message.keys()
Message.values()
Message.items()
Message.get()
Message.get_all()
Message.add_header()
Message.replace_header()
Message.get_content_type()
Message.get_content_maintype()
Message.get_content_subtype()
Message.get_default_type()
Message.set_default_type()
Message.get_params()
Message.get_param()
Message.set_param()
Message.del_param()
Message.set_type()
Message.get_filename()
Message.get_boundary()
Message.set_boundary()
Message.get_content_charset()
Message.get_charsets()
Message.get_content_disposition()
Message.walk()
Message.preamble
Message.epilogue
Message.defects
email.mime
: Creating email and MIME objects from scratchemail.header
: Internationalized headersemail.charset
: 表示字元集合Charset
Charset.input_charset
Charset.header_encoding
Charset.body_encoding
Charset.output_charset
Charset.input_codec
Charset.output_codec
Charset.get_body_encoding()
Charset.get_output_charset()
Charset.header_encode()
Charset.header_encode_lines()
Charset.body_encode()
Charset.__str__()
Charset.__eq__()
Charset.__ne__()
add_charset()
add_alias()
add_codec()
email.encoders
: Encodersemail.utils
: Miscellaneous utilitiesemail.iterators
: Iterators
json
--- JSON 編碼器與解碼器mailbox
--- 以各種格式操作郵件信箱Mailbox
物件Mailbox
Mailbox.add()
Mailbox.remove()
Mailbox.__delitem__()
Mailbox.discard()
Mailbox.__setitem__()
Mailbox.iterkeys()
Mailbox.keys()
Mailbox.itervalues()
Mailbox.__iter__()
Mailbox.values()
Mailbox.iteritems()
Mailbox.items()
Mailbox.get()
Mailbox.__getitem__()
Mailbox.get_message()
Mailbox.get_bytes()
Mailbox.get_string()
Mailbox.get_file()
Mailbox.__contains__()
Mailbox.__len__()
Mailbox.clear()
Mailbox.pop()
Mailbox.popitem()
Mailbox.update()
Mailbox.flush()
Mailbox.lock()
Mailbox.unlock()
Mailbox.close()
Mailbox
物件mbox
物件MH
物件Babyl
物件MMDF
物件
Message
物件- 例外
- 範例
mimetypes
--- Map filenames to MIME typesbase64
—— Base16、Base32、Base64、Base85 資料編碼b64encode()
b64decode()
standard_b64encode()
standard_b64decode()
urlsafe_b64encode()
urlsafe_b64decode()
b32encode()
b32decode()
b32hexencode()
b32hexdecode()
b16encode()
b16decode()
a85encode()
a85decode()
b85encode()
b85decode()
decode()
decodebytes()
encode()
encodebytes()
- Security Considerations
binascii
--- Convert between binary and ASCIIquopri
--- 編碼和解碼 MIME 可列印字元資料
- Structured Markup Processing Tools
html
--- 超連結標記語言 (HTML) 支援html.parser
--- 簡單的 HTML 和 XHTML 剖析器HTMLParser
- HTML 剖析器應用程式範例
HTMLParser
方法HTMLParser.feed()
HTMLParser.close()
HTMLParser.reset()
HTMLParser.getpos()
HTMLParser.get_starttag_text()
HTMLParser.handle_starttag()
HTMLParser.handle_endtag()
HTMLParser.handle_startendtag()
HTMLParser.handle_data()
HTMLParser.handle_entityref()
HTMLParser.handle_charref()
HTMLParser.handle_comment()
HTMLParser.handle_decl()
HTMLParser.handle_pi()
HTMLParser.unknown_decl()
- 範例
html.entities
--- HTML 一般實體的定義- XML 處理模組
xml.etree.ElementTree
--- The ElementTree XML API- 教學
- XPath 支援
- Reference
- XInclude support
- Reference
- 函式
- Element Objects
Element
Element.tag
Element.text
Element.tail
Element.attrib
Element.clear()
Element.get()
Element.items()
Element.keys()
Element.set()
Element.append()
Element.extend()
Element.find()
Element.findall()
Element.findtext()
Element.insert()
Element.iter()
Element.iterfind()
Element.itertext()
Element.makeelement()
Element.remove()
- ElementTree 物件
- QName 物件
- TreeBuilder 物件
- XMLParser 物件
- XMLPullParser 物件
- 例外
xml.dom
--- The Document Object Model API- 模組內容
- Objects in the DOM
- DOMImplementation 物件
- Node Objects
Node.nodeType
Node.parentNode
Node.attributes
Node.previousSibling
Node.nextSibling
Node.childNodes
Node.firstChild
Node.lastChild
Node.localName
Node.prefix
Node.namespaceURI
Node.nodeName
Node.nodeValue
Node.hasAttributes()
Node.hasChildNodes()
Node.isSameNode()
Node.appendChild()
Node.insertBefore()
Node.removeChild()
Node.replaceChild()
Node.normalize()
Node.cloneNode()
- NodeList 物件
- DocumentType 物件
- Document Objects
- Element Objects
Element.tagName
Element.getElementsByTagName()
Element.getElementsByTagNameNS()
Element.hasAttribute()
Element.hasAttributeNS()
Element.getAttribute()
Element.getAttributeNode()
Element.getAttributeNS()
Element.getAttributeNodeNS()
Element.removeAttribute()
Element.removeAttributeNode()
Element.removeAttributeNS()
Element.setAttribute()
Element.setAttributeNode()
Element.setAttributeNodeNS()
Element.setAttributeNS()
- Attr Objects
- NamedNodeMap 物件
- Comment Objects
- Text and CDATASection Objects
- ProcessingInstruction 物件
- 例外
- Conformance
xml.dom.minidom
--- Minimal DOM implementationxml.dom.pulldom
--- Support for building partial DOM treesxml.sax
--- Support for SAX2 parsersxml.sax.handler
--- Base classes for SAX handlersContentHandler
DTDHandler
EntityResolver
ErrorHandler
LexicalHandler
feature_namespaces
feature_namespace_prefixes
feature_string_interning
feature_validation
feature_external_ges
feature_external_pes
all_features
property_lexical_handler
property_declaration_handler
property_dom_node
property_xml_string
all_properties
- ContentHandler 物件
ContentHandler.setDocumentLocator()
ContentHandler.startDocument()
ContentHandler.endDocument()
ContentHandler.startPrefixMapping()
ContentHandler.endPrefixMapping()
ContentHandler.startElement()
ContentHandler.endElement()
ContentHandler.startElementNS()
ContentHandler.endElementNS()
ContentHandler.characters()
ContentHandler.ignorableWhitespace()
ContentHandler.processingInstruction()
ContentHandler.skippedEntity()
- DTDHandler 物件
- EntityResolver 物件
- ErrorHandler 物件
- LexicalHandler 物件
xml.sax.saxutils
--- SAX Utilitiesxml.sax.xmlreader
--- Interface for XML parsersXMLReader
IncrementalParser
Locator
InputSource
AttributesImpl
AttributesNSImpl
- XMLReader 物件
XMLReader.parse()
XMLReader.getContentHandler()
XMLReader.setContentHandler()
XMLReader.getDTDHandler()
XMLReader.setDTDHandler()
XMLReader.getEntityResolver()
XMLReader.setEntityResolver()
XMLReader.getErrorHandler()
XMLReader.setErrorHandler()
XMLReader.setLocale()
XMLReader.getFeature()
XMLReader.setFeature()
XMLReader.getProperty()
XMLReader.setProperty()
- IncrementalParser 物件
- Locator Objects
- InputSource 物件
- The
Attributes
Interface - The
AttributesNS
Interface
xml.parsers.expat
--- Fast XML parsing using ExpatExpatError
error
XMLParserType
ErrorString()
ParserCreate()
- XMLParser 物件
xmlparser.Parse()
xmlparser.ParseFile()
xmlparser.SetBase()
xmlparser.GetBase()
xmlparser.GetInputContext()
xmlparser.ExternalEntityParserCreate()
xmlparser.SetParamEntityParsing()
xmlparser.UseForeignDTD()
xmlparser.buffer_size
xmlparser.buffer_text
xmlparser.buffer_used
xmlparser.ordered_attributes
xmlparser.specified_attributes
xmlparser.ErrorByteIndex
xmlparser.ErrorCode
xmlparser.ErrorColumnNumber
xmlparser.ErrorLineNumber
xmlparser.CurrentByteIndex
xmlparser.CurrentColumnNumber
xmlparser.CurrentLineNumber
xmlparser.XmlDeclHandler()
xmlparser.StartDoctypeDeclHandler()
xmlparser.EndDoctypeDeclHandler()
xmlparser.ElementDeclHandler()
xmlparser.AttlistDeclHandler()
xmlparser.StartElementHandler()
xmlparser.EndElementHandler()
xmlparser.ProcessingInstructionHandler()
xmlparser.CharacterDataHandler()
xmlparser.UnparsedEntityDeclHandler()
xmlparser.EntityDeclHandler()
xmlparser.NotationDeclHandler()
xmlparser.StartNamespaceDeclHandler()
xmlparser.EndNamespaceDeclHandler()
xmlparser.CommentHandler()
xmlparser.StartCdataSectionHandler()
xmlparser.EndCdataSectionHandler()
xmlparser.DefaultHandler()
xmlparser.DefaultHandlerExpand()
xmlparser.NotStandaloneHandler()
xmlparser.ExternalEntityRefHandler()
- ExpatError 例外
- 範例
- Content Model Descriptions
- Expat error constants
codes
messages
XML_ERROR_ASYNC_ENTITY
XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF
XML_ERROR_BAD_CHAR_REF
XML_ERROR_BINARY_ENTITY_REF
XML_ERROR_DUPLICATE_ATTRIBUTE
XML_ERROR_INCORRECT_ENCODING
XML_ERROR_INVALID_TOKEN
XML_ERROR_JUNK_AFTER_DOC_ELEMENT
XML_ERROR_MISPLACED_XML_PI
XML_ERROR_NO_ELEMENTS
XML_ERROR_NO_MEMORY
XML_ERROR_PARAM_ENTITY_REF
XML_ERROR_PARTIAL_CHAR
XML_ERROR_RECURSIVE_ENTITY_REF
XML_ERROR_SYNTAX
XML_ERROR_TAG_MISMATCH
XML_ERROR_UNCLOSED_TOKEN
XML_ERROR_UNDEFINED_ENTITY
XML_ERROR_UNKNOWN_ENCODING
XML_ERROR_UNCLOSED_CDATA_SECTION
XML_ERROR_EXTERNAL_ENTITY_HANDLING
XML_ERROR_NOT_STANDALONE
XML_ERROR_UNEXPECTED_STATE
XML_ERROR_ENTITY_DECLARED_IN_PE
XML_ERROR_FEATURE_REQUIRES_XML_DTD
XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING
XML_ERROR_UNBOUND_PREFIX
XML_ERROR_UNDECLARING_PREFIX
XML_ERROR_INCOMPLETE_PE
XML_ERROR_XML_DECL
XML_ERROR_TEXT_DECL
XML_ERROR_PUBLICID
XML_ERROR_SUSPENDED
XML_ERROR_NOT_SUSPENDED
XML_ERROR_ABORTED
XML_ERROR_FINISHED
XML_ERROR_SUSPEND_PE
XML_ERROR_RESERVED_PREFIX_XML
XML_ERROR_RESERVED_PREFIX_XMLNS
XML_ERROR_RESERVED_NAMESPACE_URI
XML_ERROR_INVALID_ARGUMENT
XML_ERROR_NO_BUFFER
XML_ERROR_AMPLIFICATION_LIMIT_BREACH
- 網路協定 (Internet protocols) 及支援
webbrowser
--- Convenient web-browser controllerwsgiref
--- WSGI 工具與參考實作wsgiref.util
-- WSGI 環境工具wsgiref.headers
-- WSGI 回應標頭工具wsgiref.simple_server
-- 一個簡單的 WSGI HTTP 伺服器wsgiref.validate
--- WSGI 符合性檢查wsgiref.handlers
-- 伺服器 / 閘道基本類別CGIHandler
IISCGIHandler
BaseCGIHandler
SimpleHandler
BaseHandler
BaseHandler.run()
BaseHandler._write()
BaseHandler._flush()
BaseHandler.get_stdin()
BaseHandler.get_stderr()
BaseHandler.add_cgi_vars()
BaseHandler.wsgi_multithread
BaseHandler.wsgi_multiprocess
BaseHandler.wsgi_run_once
BaseHandler.os_environ
BaseHandler.server_software
BaseHandler.get_scheme()
BaseHandler.setup_environ()
BaseHandler.log_exception()
BaseHandler.traceback_limit
BaseHandler.error_output()
BaseHandler.error_status
BaseHandler.error_headers
BaseHandler.error_body
BaseHandler.wsgi_file_wrapper
BaseHandler.sendfile()
BaseHandler.origin_server
BaseHandler.http_version
read_environ()
wsgiref.types
-- 用於靜態型別檢查的 WSGI 型別- 範例
urllib
--- URL 處理模組urllib.request
--- 用來開啟 URLs 的可擴充函式庫urlopen()
install_opener()
build_opener()
pathname2url()
url2pathname()
getproxies()
Request
OpenerDirector
BaseHandler
HTTPDefaultErrorHandler
HTTPRedirectHandler
HTTPCookieProcessor
ProxyHandler
HTTPPasswordMgr
HTTPPasswordMgrWithDefaultRealm
HTTPPasswordMgrWithPriorAuth
AbstractBasicAuthHandler
HTTPBasicAuthHandler
ProxyBasicAuthHandler
AbstractDigestAuthHandler
HTTPDigestAuthHandler
ProxyDigestAuthHandler
HTTPHandler
HTTPSHandler
FileHandler
DataHandler
FTPHandler
CacheFTPHandler
UnknownHandler
HTTPErrorProcessor
- Request Objects
Request.full_url
Request.type
Request.host
Request.origin_req_host
Request.selector
Request.data
Request.unverifiable
Request.method
Request.get_method()
Request.add_header()
Request.add_unredirected_header()
Request.has_header()
Request.remove_header()
Request.get_full_url()
Request.set_proxy()
Request.get_header()
Request.header_items()
- OpenerDirector 物件
- BaseHandler 物件
- HTTPRedirectHandler 物件
- HTTPCookieProcessor 物件
- ProxyHandler 物件
- HTTPPasswordMgr 物件
- HTTPPasswordMgrWithPriorAuth 物件
- AbstractBasicAuthHandler 物件
- HTTPBasicAuthHandler 物件
- ProxyBasicAuthHandler 物件
- AbstractDigestAuthHandler 物件
- HTTPDigestAuthHandler 物件
- ProxyDigestAuthHandler 物件
- HTTPHandler 物件
- HTTPSHandler 物件
- FileHandler 物件
- DataHandler 物件
- FTPHandler 物件
- CacheFTPHandler 物件
- UnknownHandler 物件
- HTTPErrorProcessor 物件
- Examples
- Legacy interface
urllib.request
Restrictions
urllib.response
--- Response classes used by urlliburllib.parse
--- Parse URLs into componentsurllib.error
--- urllib.request 引發的例外類別urllib.robotparser
--- robots.txt 的剖析器http
--- HTTP 模組http.client
--- HTTP protocol clientHTTPConnection
HTTPSConnection
HTTPResponse
parse_headers()
HTTPException
NotConnected
InvalidURL
UnknownProtocol
UnknownTransferEncoding
UnimplementedFileMode
IncompleteRead
ImproperConnectionState
CannotSendRequest
CannotSendHeader
ResponseNotReady
BadStatusLine
LineTooLong
RemoteDisconnected
HTTP_PORT
HTTPS_PORT
responses
- HTTPConnection 物件
HTTPConnection.request()
HTTPConnection.getresponse()
HTTPConnection.set_debuglevel()
HTTPConnection.set_tunnel()
HTTPConnection.get_proxy_response_headers()
HTTPConnection.connect()
HTTPConnection.close()
HTTPConnection.blocksize
HTTPConnection.putrequest()
HTTPConnection.putheader()
HTTPConnection.endheaders()
HTTPConnection.send()
- HTTPResponse 物件
HTTPResponse.read()
HTTPResponse.readinto()
HTTPResponse.getheader()
HTTPResponse.getheaders()
HTTPResponse.fileno()
HTTPResponse.msg
HTTPResponse.version
HTTPResponse.url
HTTPResponse.headers
HTTPResponse.status
HTTPResponse.reason
HTTPResponse.debuglevel
HTTPResponse.closed
HTTPResponse.geturl()
HTTPResponse.info()
HTTPResponse.getcode()
- 範例
- HTTPMessage 物件
ftplib
--- FTP 協定用戶端FTP
error_reply
error_temp
error_perm
error_proto
all_errors
- FTP 物件
FTP.set_debuglevel()
FTP.connect()
FTP.getwelcome()
FTP.login()
FTP.abort()
FTP.sendcmd()
FTP.voidcmd()
FTP.retrbinary()
FTP.retrlines()
FTP.set_pasv()
FTP.storbinary()
FTP.storlines()
FTP.transfercmd()
FTP.ntransfercmd()
FTP.mlsd()
FTP.nlst()
FTP.dir()
FTP.rename()
FTP.delete()
FTP.cwd()
FTP.mkd()
FTP.pwd()
FTP.rmd()
FTP.size()
FTP.quit()
FTP.close()
- FTP_TLS 物件
poplib
--- POP3 protocol clientimaplib
--- IMAP4 protocol clientIMAP4
IMAP4_SSL
IMAP4_stream
Internaldate2tuple()
Int2AP()
ParseFlags()
Time2Internaldate()
- IMAP4 物件
IMAP4.append()
IMAP4.authenticate()
IMAP4.check()
IMAP4.close()
IMAP4.copy()
IMAP4.create()
IMAP4.delete()
IMAP4.deleteacl()
IMAP4.enable()
IMAP4.expunge()
IMAP4.fetch()
IMAP4.getacl()
IMAP4.getannotation()
IMAP4.getquota()
IMAP4.getquotaroot()
IMAP4.list()
IMAP4.login()
IMAP4.login_cram_md5()
IMAP4.logout()
IMAP4.lsub()
IMAP4.myrights()
IMAP4.namespace()
IMAP4.noop()
IMAP4.open()
IMAP4.partial()
IMAP4.proxyauth()
IMAP4.read()
IMAP4.readline()
IMAP4.recent()
IMAP4.rename()
IMAP4.response()
IMAP4.search()
IMAP4.select()
IMAP4.send()
IMAP4.setacl()
IMAP4.setannotation()
IMAP4.setquota()
IMAP4.shutdown()
IMAP4.socket()
IMAP4.sort()
IMAP4.starttls()
IMAP4.status()
IMAP4.store()
IMAP4.subscribe()
IMAP4.thread()
IMAP4.uid()
IMAP4.unsubscribe()
IMAP4.unselect()
IMAP4.xatom()
IMAP4.PROTOCOL_VERSION
IMAP4.debug
IMAP4.utf8_enabled
- IMAP4 範例
smtplib
--- SMTP protocol clientuuid
--- RFC 4122 定義的 UUID 物件socketserver
--- A framework for network serversTCPServer
UDPServer
UnixStreamServer
UnixDatagramServer
- Server Creation Notes
- Server Objects
BaseServer
BaseServer.fileno()
BaseServer.handle_request()
BaseServer.serve_forever()
BaseServer.service_actions()
BaseServer.shutdown()
BaseServer.server_close()
BaseServer.address_family
BaseServer.RequestHandlerClass
BaseServer.server_address
BaseServer.socket
BaseServer.allow_reuse_address
BaseServer.request_queue_size
BaseServer.socket_type
BaseServer.timeout
BaseServer.finish_request()
BaseServer.get_request()
BaseServer.handle_error()
BaseServer.handle_timeout()
BaseServer.process_request()
BaseServer.server_activate()
BaseServer.server_bind()
BaseServer.verify_request()
- Request Handler Objects
- 範例
http.server
--- HTTP serversHTTPServer
ThreadingHTTPServer
BaseHTTPRequestHandler
BaseHTTPRequestHandler.client_address
BaseHTTPRequestHandler.server
BaseHTTPRequestHandler.close_connection
BaseHTTPRequestHandler.requestline
BaseHTTPRequestHandler.command
BaseHTTPRequestHandler.path
BaseHTTPRequestHandler.request_version
BaseHTTPRequestHandler.headers
BaseHTTPRequestHandler.rfile
BaseHTTPRequestHandler.wfile
BaseHTTPRequestHandler.server_version
BaseHTTPRequestHandler.sys_version
BaseHTTPRequestHandler.error_message_format
BaseHTTPRequestHandler.error_content_type
BaseHTTPRequestHandler.protocol_version
BaseHTTPRequestHandler.MessageClass
BaseHTTPRequestHandler.responses
BaseHTTPRequestHandler.handle()
BaseHTTPRequestHandler.handle_one_request()
BaseHTTPRequestHandler.handle_expect_100()
BaseHTTPRequestHandler.send_error()
BaseHTTPRequestHandler.send_response()
BaseHTTPRequestHandler.send_header()
BaseHTTPRequestHandler.send_response_only()
BaseHTTPRequestHandler.end_headers()
BaseHTTPRequestHandler.flush_headers()
BaseHTTPRequestHandler.log_request()
BaseHTTPRequestHandler.log_error()
BaseHTTPRequestHandler.log_message()
BaseHTTPRequestHandler.version_string()
BaseHTTPRequestHandler.date_time_string()
BaseHTTPRequestHandler.log_date_time_string()
BaseHTTPRequestHandler.address_string()
SimpleHTTPRequestHandler
CGIHTTPRequestHandler
- Security Considerations
http.cookies
--- HTTP state managementCookieError
BaseCookie
SimpleCookie
- Cookie 物件
- Morsel 物件
Morsel
Morsel.expires
Morsel.path
Morsel.comment
Morsel.domain
Morsel.secure
Morsel.version
Morsel.httponly
Morsel.samesite
Morsel.value
Morsel.coded_value
Morsel.key
Morsel.set()
Morsel.isReservedKey()
Morsel.output()
Morsel.js_output()
Morsel.OutputString()
Morsel.update()
Morsel.copy()
Morsel.setdefault()
- 範例
http.cookiejar
--- Cookie handling for HTTP clientsLoadError
CookieJar
FileCookieJar
CookiePolicy
DefaultCookiePolicy
Cookie
- CookieJar 與 FileCookieJar 物件
CookieJar.add_cookie_header()
CookieJar.extract_cookies()
CookieJar.set_policy()
CookieJar.make_cookies()
CookieJar.set_cookie_if_ok()
CookieJar.set_cookie()
CookieJar.clear()
CookieJar.clear_session_cookies()
FileCookieJar.save()
FileCookieJar.load()
FileCookieJar.revert()
FileCookieJar.filename
FileCookieJar.delayload
- FileCookieJar subclasses and co-operation with web browsers
- CookiePolicy 物件
- DefaultCookiePolicy 物件
DefaultCookiePolicy.blocked_domains()
DefaultCookiePolicy.set_blocked_domains()
DefaultCookiePolicy.is_blocked()
DefaultCookiePolicy.allowed_domains()
DefaultCookiePolicy.set_allowed_domains()
DefaultCookiePolicy.is_not_allowed()
DefaultCookiePolicy.rfc2109_as_netscape
DefaultCookiePolicy.strict_domain
DefaultCookiePolicy.strict_rfc2965_unverifiable
DefaultCookiePolicy.strict_ns_unverifiable
DefaultCookiePolicy.strict_ns_domain
DefaultCookiePolicy.strict_ns_set_initial_dollar
DefaultCookiePolicy.strict_ns_set_path
DefaultCookiePolicy.DomainStrictNoDots
DefaultCookiePolicy.DomainStrictNonDomain
DefaultCookiePolicy.DomainRFC2965Match
DefaultCookiePolicy.DomainLiberal
DefaultCookiePolicy.DomainStrict
- Cookie 物件
Cookie.version
Cookie.name
Cookie.value
Cookie.port
Cookie.path
Cookie.secure
Cookie.expires
Cookie.discard
Cookie.comment
Cookie.comment_url
Cookie.rfc2109
Cookie.port_specified
Cookie.domain_specified
Cookie.domain_initial_dot
Cookie.has_nonstandard_attr()
Cookie.get_nonstandard_attr()
Cookie.set_nonstandard_attr()
Cookie.is_expired()
- 範例
xmlrpc
--- XMLRPC 伺服器與用戶模組xmlrpc.client
--- XML-RPC client accessxmlrpc.server
--- Basic XML-RPC serversipaddress
--- IPv4/IPv6 manipulation library- Convenience factory functions
- IP Addresses
- Address objects
IPv4Address
IPv4Address.version
IPv4Address.max_prefixlen
IPv4Address.compressed
IPv4Address.exploded
IPv4Address.packed
IPv4Address.reverse_pointer
IPv4Address.is_multicast
IPv4Address.is_private
IPv4Address.is_global
IPv4Address.is_unspecified
IPv4Address.is_reserved
IPv4Address.is_loopback
IPv4Address.is_link_local
IPv4Address.__format__()
IPv6Address
IPv6Address.compressed
IPv6Address.exploded
IPv6Address.packed
IPv6Address.reverse_pointer
IPv6Address.version
IPv6Address.max_prefixlen
IPv6Address.is_multicast
IPv6Address.is_private
IPv6Address.is_global
IPv6Address.is_unspecified
IPv6Address.is_reserved
IPv6Address.is_loopback
IPv6Address.is_link_local
IPv6Address.is_site_local
IPv6Address.ipv4_mapped
IPv6Address.scope_id
IPv6Address.sixtofour
IPv6Address.teredo
IPv6Address.__format__()
- Conversion to Strings and Integers
- Operators
- Address objects
- IP Network definitions
- Prefix, net mask and host mask
- Network objects
IPv4Network
IPv4Network.version
IPv4Network.max_prefixlen
IPv4Network.is_multicast
IPv4Network.is_private
IPv4Network.is_unspecified
IPv4Network.is_reserved
IPv4Network.is_loopback
IPv4Network.is_link_local
IPv4Network.network_address
IPv4Network.broadcast_address
IPv4Network.hostmask
IPv4Network.netmask
IPv4Network.with_prefixlen
IPv4Network.compressed
IPv4Network.exploded
IPv4Network.with_netmask
IPv4Network.with_hostmask
IPv4Network.num_addresses
IPv4Network.prefixlen
IPv4Network.hosts()
IPv4Network.overlaps()
IPv4Network.address_exclude()
IPv4Network.subnets()
IPv4Network.supernet()
IPv4Network.subnet_of()
IPv4Network.supernet_of()
IPv4Network.compare_networks()
IPv6Network
IPv6Network.version
IPv6Network.max_prefixlen
IPv6Network.is_multicast
IPv6Network.is_private
IPv6Network.is_unspecified
IPv6Network.is_reserved
IPv6Network.is_loopback
IPv6Network.is_link_local
IPv6Network.network_address
IPv6Network.broadcast_address
IPv6Network.hostmask
IPv6Network.netmask
IPv6Network.with_prefixlen
IPv6Network.compressed
IPv6Network.exploded
IPv6Network.with_netmask
IPv6Network.with_hostmask
IPv6Network.num_addresses
IPv6Network.prefixlen
IPv6Network.hosts()
IPv6Network.overlaps()
IPv6Network.address_exclude()
IPv6Network.subnets()
IPv6Network.supernet()
IPv6Network.subnet_of()
IPv6Network.supernet_of()
IPv6Network.compare_networks()
IPv6Network.is_site_local
- Operators
- Interface objects
- Other Module Level Functions
- Custom Exceptions
- 多媒體服務
wave
--- 讀寫 WAV 檔案open()
Error
- Wave_read 物件
Wave_read
Wave_read.close()
Wave_read.getnchannels()
Wave_read.getsampwidth()
Wave_read.getframerate()
Wave_read.getnframes()
Wave_read.getcomptype()
Wave_read.getcompname()
Wave_read.getparams()
Wave_read.readframes()
Wave_read.rewind()
Wave_read.getmarkers()
Wave_read.getmark()
Wave_read.setpos()
Wave_read.tell()
- Wave_write 物件
colorsys
--- 顏色系統間的轉換
- 國際化
gettext
--- Multilingual internationalization serviceslocale
--- Internationalization servicesError
setlocale()
localeconv()
nl_langinfo()
CODESET
D_T_FMT
D_FMT
T_FMT
T_FMT_AMPM
RADIXCHAR
THOUSEP
YESEXPR
NOEXPR
CRNCYSTR
ERA
ERA_D_T_FMT
ERA_D_FMT
ERA_T_FMT
ALT_DIGITS
getdefaultlocale()
getlocale()
getpreferredencoding()
getencoding()
normalize()
resetlocale()
strcoll()
strxfrm()
format_string()
currency()
str()
delocalize()
localize()
atof()
atoi()
LC_CTYPE
LC_COLLATE
LC_TIME
LC_MONETARY
LC_MESSAGES
LC_NUMERIC
LC_ALL
CHAR_MAX
- Background, details, hints, tips and caveats
- For extension writers and programs that embed Python
- Access to message catalogs
- 程式框架
turtle
--- 龜圖學 (Turtle graphics)- 介紹
- 教學
- How to...
- Turtle graphics reference
- Methods of RawTurtle/Turtle and corresponding functions
- Methods of TurtleScreen/Screen and corresponding functions
- Public classes
- Explanation
- Help and configuration
turtledemo
--- Demo scripts- Changes since Python 2.6
- Changes since Python 3.0
cmd
--- Support for line-oriented command interpretersCmd
- Cmd 物件
Cmd.cmdloop()
Cmd.do_help()
Cmd.onecmd()
Cmd.emptyline()
Cmd.default()
Cmd.completedefault()
Cmd.columnize()
Cmd.precmd()
Cmd.postcmd()
Cmd.preloop()
Cmd.postloop()
Cmd.prompt
Cmd.identchars
Cmd.lastcmd
Cmd.cmdqueue
Cmd.intro
Cmd.doc_header
Cmd.misc_header
Cmd.undoc_header
Cmd.ruler
Cmd.use_rawinput
- Cmd Example
shlex
--- Simple lexical analysissplit()
join()
quote()
shlex
- shlex 物件
shlex.get_token()
shlex.push_token()
shlex.read_token()
shlex.sourcehook()
shlex.push_source()
shlex.pop_source()
shlex.error_leader()
shlex.commenters
shlex.wordchars
shlex.whitespace
shlex.escape
shlex.quotes
shlex.escapedquotes
shlex.whitespace_split
shlex.infile
shlex.instream
shlex.source
shlex.debug
shlex.lineno
shlex.token
shlex.eof
shlex.punctuation_chars
- Parsing Rules
- Improved Compatibility with Shells
- 以 Tk 打造圖形使用者介面 (Graphical User Interfaces)
tkinter
--- Python interface to Tcl/Tktkinter.colorchooser
--- Color choosing dialogtkinter.font
--- Tkinter font wrapper- Tkinter Dialogs
tkinter.simpledialog
--- Standard Tkinter input dialogstkinter.filedialog
--- File selection dialogs- Native Load/Save Dialogs
askopenfile()
askopenfiles()
asksaveasfile()
askopenfilename()
askopenfilenames()
asksaveasfilename()
askdirectory()
Open
SaveAs
Directory
FileDialog
FileDialog.cancel_command()
FileDialog.dirs_double_event()
FileDialog.dirs_select_event()
FileDialog.files_double_event()
FileDialog.files_select_event()
FileDialog.filter_command()
FileDialog.get_filter()
FileDialog.get_selection()
FileDialog.go()
FileDialog.ok_event()
FileDialog.quit()
FileDialog.set_filter()
FileDialog.set_selection()
LoadFileDialog
SaveFileDialog
- Native Load/Save Dialogs
tkinter.commondialog
--- Dialog window templates
tkinter.messagebox
--- Tkinter message promptstkinter.scrolledtext
--- Scrolled Text Widgettkinter.dnd
--- Drag and drop supporttkinter.ttk
--- Tk themed widgets- Using Ttk
- Ttk Widgets
- Widget
- Combobox
- Spinbox
- Notebook
- Progressbar
- Separator
- Sizegrip
- Treeview
- 選項
- Item Options
- Tag Options
- Column Identifiers
- 虛擬事件
- ttk.Treeview
Treeview
Treeview.bbox()
Treeview.get_children()
Treeview.set_children()
Treeview.column()
Treeview.delete()
Treeview.detach()
Treeview.exists()
Treeview.focus()
Treeview.heading()
Treeview.identify()
Treeview.identify_row()
Treeview.identify_column()
Treeview.identify_region()
Treeview.identify_element()
Treeview.index()
Treeview.insert()
Treeview.item()
Treeview.move()
Treeview.next()
Treeview.parent()
Treeview.prev()
Treeview.reattach()
Treeview.see()
Treeview.selection()
Treeview.selection_set()
Treeview.selection_add()
Treeview.selection_remove()
Treeview.selection_toggle()
Treeview.set()
Treeview.tag_bind()
Treeview.tag_configure()
Treeview.tag_has()
Treeview.xview()
Treeview.yview()
- Ttk Styling
tkinter.tix
--- Tk 擴充小工具- IDLE
- 開發工具
typing
--- 支援型別提示- 相關的 PEPs
- 型別別名
- NewType
- 註釋 callable 物件
- 泛型
- 註釋元組 (tuple)
- The type of class objects
- User-defined generic types
Any
型別- Nominal vs structural subtyping
- 模組內容
- Special typing primitives
- 協定
- ABCs for working with IO
- 函式與裝飾器
- Introspection helpers
- 常數
- 棄用的別名
- Deprecation Timeline of Major Features
pydoc
--- Documentation generator and online help system- Python Development Mode
doctest
--- Test interactive Python examples- Simple Usage: Checking Examples in Docstrings
- Simple Usage: Checking Examples in a Text File
- How It Works
- Basic API
- Unittest API
- Advanced API
- Debugging
- Soapbox
unittest
--- 單元測試框架- 簡單範例
- 命令執行列介面 (Command-Line Interface)
- Test Discovery(測試探索)
- Organizing test code
- Re-using old test code
- Skipping tests and expected failures
- Distinguishing test iterations using subtests
- Classes and functions
- Test cases
TestCase
TestCase.setUp()
TestCase.tearDown()
TestCase.setUpClass()
TestCase.tearDownClass()
TestCase.run()
TestCase.skipTest()
TestCase.subTest()
TestCase.debug()
TestCase.assertEqual()
TestCase.assertNotEqual()
TestCase.assertTrue()
TestCase.assertFalse()
TestCase.assertIs()
TestCase.assertIsNot()
TestCase.assertIsNone()
TestCase.assertIsNotNone()
TestCase.assertIn()
TestCase.assertNotIn()
TestCase.assertIsInstance()
TestCase.assertNotIsInstance()
TestCase.assertRaises()
TestCase.assertRaisesRegex()
TestCase.assertWarns()
TestCase.assertWarnsRegex()
TestCase.assertLogs()
TestCase.records
TestCase.output
TestCase.assertNoLogs()
TestCase.assertAlmostEqual()
TestCase.assertNotAlmostEqual()
TestCase.assertGreater()
TestCase.assertGreaterEqual()
TestCase.assertLess()
TestCase.assertLessEqual()
TestCase.assertRegex()
TestCase.assertNotRegex()
TestCase.assertCountEqual()
TestCase.addTypeEqualityFunc()
TestCase.assertMultiLineEqual()
TestCase.assertSequenceEqual()
TestCase.assertListEqual()
TestCase.assertTupleEqual()
TestCase.assertSetEqual()
TestCase.assertDictEqual()
TestCase.fail()
TestCase.failureException
TestCase.longMessage
TestCase.maxDiff
TestCase.countTestCases()
TestCase.defaultTestResult()
TestCase.id()
TestCase.shortDescription()
TestCase.addCleanup()
TestCase.enterContext()
TestCase.doCleanups()
TestCase.addClassCleanup()
TestCase.enterClassContext()
TestCase.doClassCleanups()
IsolatedAsyncioTestCase
FunctionTestCase
- Grouping tests
- Loading and running tests
TestLoader
TestLoader.errors
TestLoader.loadTestsFromTestCase()
TestLoader.loadTestsFromModule()
TestLoader.loadTestsFromName()
TestLoader.loadTestsFromNames()
TestLoader.getTestCaseNames()
TestLoader.discover()
TestLoader.testMethodPrefix
TestLoader.sortTestMethodsUsing
TestLoader.suiteClass
TestLoader.testNamePatterns
TestResult
TestResult.errors
TestResult.failures
TestResult.skipped
TestResult.expectedFailures
TestResult.unexpectedSuccesses
TestResult.collectedDurations
TestResult.shouldStop
TestResult.testsRun
TestResult.buffer
TestResult.failfast
TestResult.tb_locals
TestResult.wasSuccessful()
TestResult.stop()
TestResult.startTest()
TestResult.stopTest()
TestResult.startTestRun()
TestResult.stopTestRun()
TestResult.addError()
TestResult.addFailure()
TestResult.addSuccess()
TestResult.addSkip()
TestResult.addExpectedFailure()
TestResult.addUnexpectedSuccess()
TestResult.addSubTest()
TestResult.addDuration()
TextTestResult
defaultTestLoader
TextTestRunner
main()
- load_tests Protocol
- Test cases
- Class and Module Fixtures
- Signal Handling
unittest.mock
— mock 物件函式庫- 快速導引
- Mock 類別
Mock
Mock.assert_called()
Mock.assert_called_once()
Mock.assert_called_with()
Mock.assert_called_once_with()
Mock.assert_any_call()
Mock.assert_has_calls()
Mock.assert_not_called()
Mock.reset_mock()
Mock.mock_add_spec()
Mock.attach_mock()
Mock.configure_mock()
Mock.__dir__()
Mock._get_child_mock()
Mock.called
Mock.call_count
Mock.return_value
Mock.side_effect
Mock.call_args
Mock.call_args_list
Mock.method_calls
Mock.mock_calls
Mock.__class__
NonCallableMock
PropertyMock
AsyncMock
AsyncMock.assert_awaited()
AsyncMock.assert_awaited_once()
AsyncMock.assert_awaited_with()
AsyncMock.assert_awaited_once_with()
AsyncMock.assert_any_await()
AsyncMock.assert_has_awaits()
AsyncMock.assert_not_awaited()
AsyncMock.reset_mock()
AsyncMock.await_count
AsyncMock.await_args
AsyncMock.await_args_list
- 呼叫
- Deleting Attributes
- Mock names and the name attribute
- Attaching Mocks as Attributes
- The patchers
- MagicMock and magic method support
- Helpers
unittest.mock
--- 入門指南- 使用 Mock 的方式
- 使用 Mock 來 patching 方法
- 對物件的方法呼叫使用 mock
- Mocking Classes
- Naming your mocks
- Tracking all Calls
- Setting Return Values and Attributes
- Raising exceptions with mocks
- Side effect functions and iterables
- Mocking asynchronous iterators
- Mocking asynchronous context manager
- Creating a Mock from an Existing Object
- Using side_effect to return per file content
- Patch Decorators
- Further Examples
- Mocking chained calls
- Partial mocking
- Mocking a Generator Method
- Applying the same patch to every test method
- Mocking Unbound Methods
- Checking multiple calls with mock
- Coping with mutable arguments
- Nesting Patches
- Mocking a dictionary with MagicMock
- Mock subclasses and their attributes
- Mocking imports with patch.dict
- Tracking order of calls and less verbose call assertions
- More complex argument matching
- 使用 Mock 的方式
- 2to3 --- 自動將 Python 2的程式碼轉成 Python 3
test
--- Python 的回歸測試 (regression tests) 套件test.support
--- Python 測試套件的工具TestFailed
ResourceDenied
verbose
is_jython
is_android
unix_shell
LOOPBACK_TIMEOUT
INTERNET_TIMEOUT
SHORT_TIMEOUT
LONG_TIMEOUT
PGO
PIPE_MAX_SIZE
Py_DEBUG
SOCK_MAX_SIZE
TEST_SUPPORT_DIR
TEST_HOME_DIR
TEST_DATA_DIR
MAX_Py_ssize_t
max_memuse
real_max_memuse
MISSING_C_DOCSTRINGS
HAVE_DOCSTRINGS
TEST_HTTP_URL
ALWAYS_EQ
NEVER_EQ
LARGEST
SMALLEST
busy_retry()
sleeping_retry()
is_resource_enabled()
python_is_optimized()
with_pymalloc()
requires()
sortdict()
findfile()
get_pagesize()
setswitchinterval()
check_impl_detail()
set_memlimit()
record_original_stdout()
get_original_stdout()
args_from_interpreter_flags()
optim_args_from_interpreter_flags()
captured_stdin()
captured_stdout()
captured_stderr()
disable_faulthandler()
gc_collect()
disable_gc()
swap_attr()
swap_item()
flush_std_streams()
print_warning()
wait_process()
calcobjsize()
calcvobjsize()
checksizeof()
anticipate_failure()
system_must_validate_cert()
run_with_locale()
run_with_tz()
requires_freebsd_version()
requires_linux_version()
requires_mac_version()
requires_IEEE_754()
requires_zlib()
requires_gzip()
requires_bz2()
requires_lzma()
requires_resource()
requires_docstrings()
requires_limited_api()
cpython_only()
impl_detail()
no_tracing()
refcount_test()
bigmemtest()
bigaddrspacetest()
check_syntax_error()
open_urlresource()
reap_children()
get_attribute()
catch_unraisable_exception()
load_package_tests()
detect_api_mismatch()
patch()
run_in_subinterp()
check_free_after_iterating()
missing_compiler_executable()
check__all__()
skip_if_broken_multiprocessing_synchronize()
check_disallow_instantiation()
adjust_int_max_str_digits()
SuppressCrashReport
SaveSignals
Matcher
test.support.socket_helper
--- 用於 socket 測試的工具test.support.script_helper
--- 用於 Python 執行測試的工具test.support.bytecode_helper
--- 用於測試位元組碼能正確產生的支援工具test.support.threading_helper
--- Utilities for threading teststest.support.os_helper
--- 用於 os 測試的工具FS_NONASCII
SAVEDCWD
TESTFN
TESTFN_NONASCII
TESTFN_UNENCODABLE
TESTFN_UNDECODABLE
TESTFN_UNICODE
EnvironmentVarGuard
FakePath
can_symlink()
can_xattr()
change_cwd()
create_empty_file()
fd_count()
fs_is_case_insensitive()
make_bad_fd()
rmdir()
rmtree()
skip_unless_symlink()
skip_unless_xattr()
temp_cwd()
temp_dir()
temp_umask()
unlink()
test.support.import_helper
--- 用於 import 測試的工具test.support.warnings_helper
--- 用於 warnings 測試的工具
- 除錯與效能分析
- 稽核事件表
bdb
--- Debugger frameworkBdbQuit
Breakpoint
Bdb
Bdb.canonic()
Bdb.reset()
Bdb.trace_dispatch()
Bdb.dispatch_line()
Bdb.dispatch_call()
Bdb.dispatch_return()
Bdb.dispatch_exception()
Bdb.is_skipped_line()
Bdb.stop_here()
Bdb.break_here()
Bdb.break_anywhere()
Bdb.user_call()
Bdb.user_line()
Bdb.user_return()
Bdb.user_exception()
Bdb.do_clear()
Bdb.set_step()
Bdb.set_next()
Bdb.set_return()
Bdb.set_until()
Bdb.set_trace()
Bdb.set_continue()
Bdb.set_quit()
Bdb.set_break()
Bdb.clear_break()
Bdb.clear_bpbynumber()
Bdb.clear_all_file_breaks()
Bdb.clear_all_breaks()
Bdb.get_bpbynumber()
Bdb.get_break()
Bdb.get_breaks()
Bdb.get_file_breaks()
Bdb.get_all_breaks()
Bdb.get_stack()
Bdb.format_stack_entry()
Bdb.run()
Bdb.runeval()
Bdb.runctx()
Bdb.runcall()
checkfuncname()
effective()
set_trace()
faulthandler
--- Dump the Python tracebackpdb
--- The Python Debugger- The Python Profilers
timeit
--- 測量小量程式片段的執行時間trace
--- Trace or track Python statement executiontracemalloc
--- Trace memory allocations
- 軟體封裝與發布
- Python Runtime Services
sys
--- 系統特定的參數與函式abiflags
addaudithook()
argv
audit()
base_exec_prefix
base_prefix
byteorder
builtin_module_names
call_tracing()
copyright
_clear_type_cache()
_current_frames()
_current_exceptions()
breakpointhook()
_debugmallocstats()
dllhandle
displayhook()
dont_write_bytecode
_emscripten_info
pycache_prefix
excepthook()
__breakpointhook__
__displayhook__
__excepthook__
__unraisablehook__
exception()
exc_info()
exec_prefix
executable
exit()
flags
flags.debug
flags.inspect
flags.interactive
flags.isolated
flags.optimize
flags.dont_write_bytecode
flags.no_user_site
flags.no_site
flags.ignore_environment
flags.verbose
flags.bytes_warning
flags.quiet
flags.hash_randomization
flags.dev_mode
flags.utf8_mode
flags.safe_path
flags.int_max_str_digits
flags.warn_default_encoding
float_info
float_repr_style
getallocatedblocks()
getunicodeinternedsize()
getandroidapilevel()
getdefaultencoding()
getdlopenflags()
getfilesystemencoding()
getfilesystemencodeerrors()
get_int_max_str_digits()
getrefcount()
getrecursionlimit()
getsizeof()
getswitchinterval()
_getframe()
_getframemodulename()
getprofile()
gettrace()
getwindowsversion()
get_asyncgen_hooks()
get_coroutine_origin_tracking_depth()
hash_info
hexversion
implementation
int_info
__interactivehook__
intern()
is_finalizing()
last_exc
last_type
last_value
last_traceback
maxsize
maxunicode
meta_path
modules
orig_argv
path
path_hooks
path_importer_cache
platform
platlibdir
prefix
ps1
ps2
setdlopenflags()
set_int_max_str_digits()
setprofile()
setrecursionlimit()
setswitchinterval()
settrace()
set_asyncgen_hooks()
set_coroutine_origin_tracking_depth()
activate_stack_trampoline()
deactivate_stack_trampoline()
is_stack_trampoline_active()
_enablelegacywindowsfsencoding()
stdin
stdout
stderr
__stdin__
__stdout__
__stderr__
stdlib_module_names
thread_info
tracebacklimit
unraisablehook()
version
api_version
version_info
warnoptions
winver
_xoptions
sys.monitoring
--- Execution event monitoringsysconfig
--- Provide access to Python's configuration informationbuiltins
--- 內建物件__main__
--- 頂層程式碼環境warnings
--- Warning controldataclasses
--- Data Classescontextlib
--- Utilities forwith
-statement contexts- Utilities
- Examples and Recipes
- Single use, reusable and reentrant context managers
abc
--- 抽象基底類別atexit
--- Exit handlerstraceback
--- Print or retrieve a stack tracebackprint_tb()
print_exception()
print_exc()
print_last()
print_stack()
extract_tb()
extract_stack()
format_list()
format_exception_only()
format_exception()
format_exc()
format_tb()
format_stack()
clear_frames()
walk_stack()
walk_tb()
TracebackException
物件TracebackException
TracebackException.__cause__
TracebackException.__context__
TracebackException.exceptions
TracebackException.__suppress_context__
TracebackException.__notes__
TracebackException.stack
TracebackException.exc_type
TracebackException.filename
TracebackException.lineno
TracebackException.end_lineno
TracebackException.text
TracebackException.offset
TracebackException.end_offset
TracebackException.msg
TracebackException.from_exception()
TracebackException.print()
TracebackException.format()
TracebackException.format_exception_only()
StackSummary
物件FrameSummary
物件- Traceback Examples
__future__
--- Future 陳述式定義gc
--- 垃圾回收器介面 (Garbage Collector interface)enable()
disable()
isenabled()
collect()
set_debug()
get_debug()
get_objects()
get_stats()
set_threshold()
get_count()
get_threshold()
get_referrers()
get_referents()
is_tracked()
is_finalized()
freeze()
unfreeze()
get_freeze_count()
garbage
callbacks
DEBUG_STATS
DEBUG_COLLECTABLE
DEBUG_UNCOLLECTABLE
DEBUG_SAVEALL
DEBUG_LEAK
inspect
--- 檢視活動物件- Types and members
getmembers()
getmembers_static()
getmodulename()
ismodule()
isclass()
ismethod()
isfunction()
isgeneratorfunction()
isgenerator()
iscoroutinefunction()
markcoroutinefunction()
iscoroutine()
isawaitable()
isasyncgenfunction()
isasyncgen()
istraceback()
isframe()
iscode()
isbuiltin()
ismethodwrapper()
isroutine()
isabstract()
ismethoddescriptor()
isdatadescriptor()
isgetsetdescriptor()
ismemberdescriptor()
- Retrieving source code
- Introspecting callables with the Signature object
- 類別與函式
- The interpreter stack
- Fetching attributes statically
- Current State of Generators, Coroutines, and Asynchronous Generators
- Code Objects Bit Flags
- Buffer flags
BufferFlags
BufferFlags.SIMPLE
BufferFlags.WRITABLE
BufferFlags.FORMAT
BufferFlags.ND
BufferFlags.STRIDES
BufferFlags.C_CONTIGUOUS
BufferFlags.F_CONTIGUOUS
BufferFlags.ANY_CONTIGUOUS
BufferFlags.INDIRECT
BufferFlags.CONTIG
BufferFlags.CONTIG_RO
BufferFlags.STRIDED
BufferFlags.STRIDED_RO
BufferFlags.RECORDS
BufferFlags.RECORDS_RO
BufferFlags.FULL
BufferFlags.FULL_RO
BufferFlags.READ
BufferFlags.WRITE
- 命令列介面
- Types and members
site
--- Site-specific configuration hook
- Custom Python Interpreters
- 引入模組
zipimport
--- Import modules from Zip archivespkgutil
--- Package extension utilitymodulefinder
--- Find modules used by a scriptrunpy
--- Locating and executing Python modulesimportlib
---import
的實作- 簡介
- 函式
importlib.abc
-- Abstract base classes related to importimportlib.machinery
-- Importers and path hooksimportlib.util
-- Utility code for importers- 範例
importlib.resources
-- Package resource reading, opening and accessimportlib.resources.abc
-- Abstract base classes for resourcesimportlib.metadata
-- Accessing package metadata- The initialization of the
sys.path
module search path
- Python Language Services
ast
--- 抽象語法樹 (Abstract Syntax Trees)- 抽象文法 (Abstract Grammar)
- 節點 (Node) 類別
AST
- 根節點
- 文本 (Literals)
- 變數
- 運算式
- 陳述式
- 流程控制
- 模式匹配 (pattern matching)
- 型別參數 (type parameters)
- 函式和類別定義
- async 和 await
ast
輔助程式- 編譯器旗標
- 命令列用法
symtable
--- 存取編譯器的符號表token
--- Constants used with Python parse treestok_name
ISTERMINAL()
ISNONTERMINAL()
ISEOF()
ENDMARKER
NAME
NUMBER
STRING
NEWLINE
INDENT
DEDENT
LPAR
RPAR
LSQB
RSQB
COLON
COMMA
SEMI
PLUS
MINUS
STAR
SLASH
VBAR
AMPER
LESS
GREATER
EQUAL
DOT
PERCENT
LBRACE
RBRACE
EQEQUAL
NOTEQUAL
LESSEQUAL
GREATEREQUAL
TILDE
CIRCUMFLEX
LEFTSHIFT
RIGHTSHIFT
DOUBLESTAR
PLUSEQUAL
MINEQUAL
STAREQUAL
SLASHEQUAL
PERCENTEQUAL
AMPEREQUAL
VBAREQUAL
CIRCUMFLEXEQUAL
LEFTSHIFTEQUAL
RIGHTSHIFTEQUAL
DOUBLESTAREQUAL
DOUBLESLASH
DOUBLESLASHEQUAL
AT
ATEQUAL
RARROW
ELLIPSIS
COLONEQUAL
EXCLAMATION
OP
AWAIT
ASYNC
TYPE_IGNORE
TYPE_COMMENT
SOFT_KEYWORD
FSTRING_START
FSTRING_MIDDLE
FSTRING_END
COMMENT
NL
ERRORTOKEN
N_TOKENS
NT_OFFSET
ENCODING
keyword
--- 檢驗 Python 關鍵字tokenize
--- Tokenizer for Python sourcetabnanny
--- 偵測不良縮排pyclbr
--- Python module browser supportpy_compile
— 編譯 Python 來源檔案compileall
--- Byte-compile Python librariesdis
--- Python bytecode的反組譯器pickletools
--- pickle 開發者的工具
- MS Windows 特有服務
msvcrt
--- Useful routines from the MS VC++ runtimewinreg
--- Windows registry access- 函式
CloseKey()
ConnectRegistry()
CreateKey()
CreateKeyEx()
DeleteKey()
DeleteKeyEx()
DeleteValue()
EnumKey()
EnumValue()
ExpandEnvironmentStrings()
FlushKey()
LoadKey()
OpenKey()
OpenKeyEx()
QueryInfoKey()
QueryValue()
QueryValueEx()
SaveKey()
SetValue()
SetValueEx()
DisableReflectionKey()
EnableReflectionKey()
QueryReflectionKey()
- 常數
- Registry Handle Objects
- 函式
winsound
--- Sound-playing interface for Windows
- Unix 特有服務
posix
--- 最常見的 POSIX 系統呼叫pwd
--- 密碼資料庫grp
--- The group databasetermios
--- POSIX style tty controltty
--- 終端機控制函式pty
--- Pseudo-terminal utilitiesfcntl
--- Thefcntl
andioctl
system callsresource
--- Resource usage informationerror
- Resource Limits
RLIM_INFINITY
getrlimit()
setrlimit()
prlimit()
RLIMIT_CORE
RLIMIT_CPU
RLIMIT_FSIZE
RLIMIT_DATA
RLIMIT_STACK
RLIMIT_RSS
RLIMIT_NPROC
RLIMIT_NOFILE
RLIMIT_OFILE
RLIMIT_MEMLOCK
RLIMIT_VMEM
RLIMIT_AS
RLIMIT_MSGQUEUE
RLIMIT_NICE
RLIMIT_RTPRIO
RLIMIT_RTTIME
RLIMIT_SIGPENDING
RLIMIT_SBSIZE
RLIMIT_SWAP
RLIMIT_NPTS
RLIMIT_KQUEUES
- Resource Usage
syslog
--- Unix syslog library routines
- 模組命令列介面
- 已被取代的模組
aifc
--- 讀寫 AIFF 與 AIFC 檔案open()
aifc.getnchannels()
aifc.getsampwidth()
aifc.getframerate()
aifc.getnframes()
aifc.getcomptype()
aifc.getcompname()
aifc.getparams()
aifc.getmarkers()
aifc.getmark()
aifc.readframes()
aifc.rewind()
aifc.setpos()
aifc.tell()
aifc.close()
aifc.aiff()
aifc.aifc()
aifc.setnchannels()
aifc.setsampwidth()
aifc.setframerate()
aifc.setnframes()
aifc.setcomptype()
aifc.setparams()
aifc.setmark()
aifc.writeframes()
aifc.writeframesraw()
audioop
--- 操作原始聲音檔案cgi
--- 通用閘道器介面支援cgitb
--- CGI 腳本的回溯 (traceback) 管理程式chunk
--- 讀取 IFF 分塊資料crypt
--- 用於檢查 Unix 密碼的函式imghdr
--- 推測圖片種類mailcap
--- Mailcap file handlingmsilib
--- 讀寫 Microsoft Installer 檔案nis
--- Sun NIS (Yellow Pages) 介面nntplib
--- NNTP 協定客戶端NNTP
NNTP_SSL
NNTPError
NNTPReplyError
NNTPTemporaryError
NNTPPermanentError
NNTPProtocolError
NNTPDataError
- NNTP 物件
- 屬性
- Methods
NNTP.quit()
NNTP.getwelcome()
NNTP.getcapabilities()
NNTP.login()
NNTP.starttls()
NNTP.newgroups()
NNTP.newnews()
NNTP.list()
NNTP.descriptions()
NNTP.description()
NNTP.group()
NNTP.over()
NNTP.help()
NNTP.stat()
NNTP.next()
NNTP.last()
NNTP.article()
NNTP.head()
NNTP.body()
NNTP.post()
NNTP.ihave()
NNTP.date()
NNTP.slave()
NNTP.set_debuglevel()
NNTP.xhdr()
NNTP.xover()
- Utility functions
optparse
--- Parser for command line options- Background
- Tutorial
- Reference Guide
- Option Callbacks
- Defining a callback option
- How callbacks are called
- Raising errors in a callback
- Callback example 1: trivial callback
- Callback example 2: check option order
- Callback example 3: check option order (generalized)
- Callback example 4: check arbitrary condition
- Callback example 5: fixed arguments
- Callback example 6: variable arguments
- Extending
optparse
- Exceptions
ossaudiodev
--- 對 OSS 相容聲音裝置的存取OSSAudioError
open()
openmixer()
- Audio Device Objects
oss_audio_device.close()
oss_audio_device.fileno()
oss_audio_device.read()
oss_audio_device.write()
oss_audio_device.writeall()
oss_audio_device.nonblock()
oss_audio_device.getfmts()
oss_audio_device.setfmt()
oss_audio_device.channels()
oss_audio_device.speed()
oss_audio_device.sync()
oss_audio_device.reset()
oss_audio_device.post()
oss_audio_device.setparameters()
oss_audio_device.bufsize()
oss_audio_device.obufcount()
oss_audio_device.obuffree()
oss_audio_device.closed
oss_audio_device.name
oss_audio_device.mode
- Mixer Device Objects
pipes
--- shell pipelines 介面sndhdr
--- 判定聲音檔案的型別spwd
--- shadow 密碼資料庫sunau
--- 讀寫 Sun AU 檔案open()
Error
AUDIO_FILE_MAGIC
AUDIO_FILE_ENCODING_MULAW_8
AUDIO_FILE_ENCODING_LINEAR_8
AUDIO_FILE_ENCODING_LINEAR_16
AUDIO_FILE_ENCODING_LINEAR_24
AUDIO_FILE_ENCODING_LINEAR_32
AUDIO_FILE_ENCODING_ALAW_8
AUDIO_FILE_ENCODING_FLOAT
AUDIO_FILE_ENCODING_DOUBLE
AUDIO_FILE_ENCODING_ADPCM_G721
AUDIO_FILE_ENCODING_ADPCM_G722
AUDIO_FILE_ENCODING_ADPCM_G723_3
AUDIO_FILE_ENCODING_ADPCM_G723_5
- AU_read 物件
- AU_write 物件
telnetlib
--- Telnet 客戶端Telnet
- Telnet Objects
Telnet.read_until()
Telnet.read_all()
Telnet.read_some()
Telnet.read_very_eager()
Telnet.read_eager()
Telnet.read_lazy()
Telnet.read_very_lazy()
Telnet.read_sb_data()
Telnet.open()
Telnet.msg()
Telnet.set_debuglevel()
Telnet.close()
Telnet.get_socket()
Telnet.fileno()
Telnet.write()
Telnet.interact()
Telnet.mt_interact()
Telnet.expect()
Telnet.set_option_negotiation_callback()
- Telnet 範例
xdrlib
--- uuencode 檔案的編碼與解碼xdrlib
--- XDR 資料的編碼與解碼Packer
Unpacker
- Packer Objects
- Unpacker Objects
Unpacker.reset()
Unpacker.get_position()
Unpacker.set_position()
Unpacker.get_buffer()
Unpacker.done()
Unpacker.unpack_float()
Unpacker.unpack_double()
Unpacker.unpack_fstring()
Unpacker.unpack_fopaque()
Unpacker.unpack_string()
Unpacker.unpack_opaque()
Unpacker.unpack_bytes()
Unpacker.unpack_list()
Unpacker.unpack_farray()
Unpacker.unpack_array()
- 例外
- 安全性注意事項
- 擴充和嵌入 Python 直譯器
- 推薦的第三方工具
- 不使用第三方工具建立擴充
- 1. 以 C 或 C++ 擴充 Python
- 1.1. 一個簡單範例
- 1.2. Intermezzo: Errors and Exceptions
- 1.3. 回到範例
- 1.4. The Module's Method Table and Initialization Function
- 1.5. Compilation and Linkage
- 1.6. Calling Python Functions from C
- 1.7. Extracting Parameters in Extension Functions
- 1.8. Keyword Parameters for Extension Functions
- 1.9. Building Arbitrary Values
- 1.10. Reference Counts
- 1.11. Writing Extensions in C++
- 1.12. Providing a C API for an Extension Module
- 2. Defining Extension Types: Tutorial
- 3. Defining Extension Types: Assorted Topics
- 4. 建立 C 與 C++ 擴充套件
- 5. Building C and C++ Extensions on Windows
- 1. 以 C 或 C++ 擴充 Python
- 在更大的應用程式中嵌入 CPython 運行環境 (runtime)
- Python/C API 參考手冊
- 簡介
- C API 穩定性
- The Very High Level Layer
- 參照計數
- 例外處理
- 工具
- 抽象物件層 (Abstract Objects Layer)
- 具體物件層
- 基礎物件
- 數值物件
- 序列物件
- 容器物件
- 函式物件
- 其他物件
- Initialization, Finalization, and Threads
- Before Python Initialization
- Global configuration variables
- Initializing and finalizing the interpreter
- Process-wide parameters
- Thread State and the Global Interpreter Lock
- Sub-interpreter support
- Asynchronous Notifications
- Profiling and Tracing
- Advanced Debugger Support
- Thread Local Storage Support
- Python Initialization Configuration
- 記憶體管理
- Object Implementation Support
- API 和 ABI 版本管理
- 安裝 Python 模組
- Python 如何達成任務
- 如何將 Python 2 的程式碼移植到 Python 3
- 簡短的說明
- 詳細的
- Different versions of Python 2
- Make sure you specify the proper version support in your
setup.py
file - 有好的測試覆蓋率
- 注意 Python 2 & 3 的差異
- 更新你的程式碼
- Prevent compatibility regressions
- Check which dependencies block your transition
- Update your
setup.py
file to denote Python 3 compatibility - Use continuous integration to stay compatible
- Consider using optional static type checking
- 遷移延伸模組到 Python 3
- Curses Programming with Python
- 描述器 HowTo 指南
- Enum HOWTO
- Programmatic access to enumeration members and their attributes
- Duplicating enum members and values
- Ensuring unique enumeration values
- Using automatic values
- Iteration
- Comparisons
- Allowed members and attributes of enumerations
- Restricted Enum subclassing
- Dataclass support
- Pickling
- Functional API
- Derived Enumerations
- When to use
__new__()
vs.__init__()
- How are Enums and Flags different?
- Enum Cookbook
- Subclassing EnumType
- 函式編程 HOWTO
- 如何使用 Logging 模組
- Logging Cookbook
- Using logging in multiple modules
- Logging from multiple threads
- Multiple handlers and formatters
- Logging to multiple destinations
- Custom handling of levels
- Configuration server example
- Dealing with handlers that block
- Sending and receiving logging events across a network
- Adding contextual information to your logging output
- Use of
contextvars
- Imparting contextual information in handlers
- Logging to a single file from multiple processes
- Using file rotation
- Use of alternative formatting styles
- Customizing
LogRecord
- Subclassing QueueHandler - a ZeroMQ example
- Subclassing QueueListener - a ZeroMQ example
- An example dictionary-based configuration
- Using a rotator and namer to customize log rotation processing
- A more elaborate multiprocessing example
- Inserting a BOM into messages sent to a SysLogHandler
- Implementing structured logging
- Customizing handlers with
dictConfig()
- Using particular formatting styles throughout your application
- Configuring filters with
dictConfig()
- Customized exception formatting
- Speaking logging messages
- Buffering logging messages and outputting them conditionally
- Sending logging messages to email, with buffering
- Formatting times using UTC (GMT) via configuration
- Using a context manager for selective logging
- A CLI application starter template
- A Qt GUI for logging
- Logging to syslog with RFC5424 support
- How to treat a logger like an output stream
- Patterns to avoid
- Other resources
- 如何使用正規表達式
- Socket 程式設計指南
- 如何排序
- Unicode HOWTO
- 如何使用 urllib 套件取得網路資源
- Argparse 教學
- ipaddress 模組介紹
- 使用 DTrace 和 SystemTap 檢測 CPython
- Python 對 Linux
perf
分析器的支援 - 註釋 (annotation) 最佳實踐
- Isolating Extension Modules
- Who should read this
- Background
- Making Modules Safe with Multiple Interpreters
- Heap Types
- Open Issues
- 如何將 Python 2 的程式碼移植到 Python 3
- Python 常見問題
- 一般的 Python 常見問答集
- 程式開發常見問答集
- 設計和歷史常見問答集
- 為什麼 Python 使用縮排將陳述式進行分組?
- 為什麼我會從簡單的數學運算得到奇怪的結果?
- 為何浮點數運算如此不精確?
- 為什麼 Python 字串不可變動?
- 為何「self」在方法 (method) 定義和呼叫時一定要明確使用?
- 為何我不能在運算式 (expression) 中使用指派運算?
- 為何 Python 對於一些功能實作使用方法(像是 list.index()),另一些使用函式(像是 len(list))?
- 為何 join() 是字串方法而非串列 (list) 或元組 (tuple) 方法?
- 例外處理有多快?
- 為什麼 Python 內沒有 switch 或 case 陳述式?
- 為何不能在直譯器上模擬執行緒,而要使用作業系統的特定實作方式?
- 為何 lambda 運算式不能包含陳述式?
- Python 可以被編譯成機器語言、C 語言或其他種語言嗎?
- Python 如何管理記憶體?
- 為何 CPython 不使用更多傳統的垃圾回收機制?
- 當 CPython 結束時,為何所有的記憶體不會被釋放?
- 為何要把元組 (tuple) 和串列 (list) 分成兩個資料型態?
- 串列 (list) 在 CPython 中是怎麼實作的?
- 字典 (dictionaries) 在 CPython 中是怎麼實作的?
- 為何字典的鍵一定是不可變的?
- 為何 list.sort() 不是回傳排序過的串列?
- 如何在 Python 中指定和強制使用一個介面規範 (interface spec)?
- 為何沒有 goto 語法?
- 為何純字串 (r-string) 不能以反斜線結尾?
- 為何 Python 沒有屬性賦值的 with 陳述式?
- 為何產生器 (generator) 不支援 with 陳述式?
- 為何 if、while、def、class 陳述式裡需要冒號?
- 為何 Python 允許在串列和元組末端加上逗號?
- 函式庫和擴充功能的常見問題
- 擴充/嵌入常見問題集
- 我可以在 C 中建立自己的函式嗎?
- 我可以在 C++ 中建立自己的函式嗎?
- 寫 C 很難;還有其他選擇嗎?
- 如何從 C 執行任意 Python 陳述式?
- How can I evaluate an arbitrary Python expression from C?
- 如何從 Python 物件中提取 C 值?
- 如何使用 Py_BuildValue() 建立任意長度的元組?
- 如何從 C 呼叫物件的方法?
- 我如何捕捉 PyErr_Print() 的輸出(或任何印出到 stdout/stderr 的東西)?
- 如何從 C 存取用 Python 編寫的模組?
- How do I interface to C++ objects from Python?
- 我使用安裝檔案新增了一個模組,但 make 失敗了;為什麼?
- 如何為擴充套件除錯?
- 我想在我的 Linux 系統上編譯一個 Python 模組,但是缺少一些檔案。為什麼?
- 如何從「無效輸入」區分出「不完整輸入」?
- 如何找到未定義的 g++ 符號 __builtin_new 或 __pure_virtual?
- Can I create an object class with some methods implemented in C and others in Python (e.g. through inheritance)?
- 在 Windows 使用 Python 的常見問答集
- 圖形使用者介面常見問答集
- 「為什麼 Python 被安裝在我的機器上?」常見問答集
- 術語表
- 關於這些說明文件
- 處理錯誤 (Bug)
- 版權宣告
- 沿革與授權