2022年1月4日 星期二
Pytnon2.x
跟上時代,現代人需要學Python的五大理由

人工智慧發展如日中天,如何和電腦對話逐漸成為現代人必備的技能之一。特別的是,最新出爐的108課綱首度將程式語言納入中學課程,政府將「與電腦對話的能力」視為未來台灣重要的競爭力,開始向下扎根;對於白領工作者而言,透過程式語言工具為自己加值,更是近幾年的大趨勢。
然而,程式語言百百種,而且並非所有人都具有資工、程式背景,找到一個好入門、易上手的工具就非常重要!Python是近幾年高速成長並且逐漸普及的程式語言,知名程式設計交流網站Stackoverflow大膽直言,Python將會取代其他程式語言,成為全世界最快速成長與廣泛使用的語言。
同時,Python也被視為執行機器學習最好的程式語言。換句話說,如果想要進入人工智慧領域,Python是最好入門的工具。因此,Python為何如此熱門?
理由一:容易學、好上手
Python對於新手而言是相對容易學習與上手,也可以說是最容易使用的程式語言之一,主要在於它的語法是簡化而不複雜的,同時強調自然語言,更貼近使用者的習慣。由於Python降低了操作門檻,因此跟其他程式語言相比,可以更輕鬆且快速執行。
Python是在1980年代由荷蘭電腦工程師吉多·范羅蘇姆(Guido van Rossum)所開發,他當時設計的初衷,就是希望將Python設計成具通用、普遍性的語言,即使是業餘開發人員也可以輕鬆閱讀和理解。
理由二:成熟且具支持性的Python社群
經過三十年的養成,Python的社群已經成長茁壯,有足夠的能量可以支持從初階入門者到專家級別的開發人員。這個社群提供了大量有關Python語言的文件、指引和教學影片,讓不同級別或年紀的學習者與開發人員都可以使用,增強他們在撰寫Python程式所需的知識。
任何一個程式語言,如果缺少了開發人員所提供的文件或支持,那麼它就很難被廣泛使用。Python就沒有這類的問題,因為它已經存在很長的時間,而且是最活躍的程式語言社群之一。這也意味著,如果有人對Python有疑問,他們可以從社群裡來自不同地方的開發人員獲得即時性的支持。
理由三:上百個Python函式庫與框架
因為背後強大的社群,Python有上百個出色的函式庫供開發者來使用,這可以大幅節省開發初期所耗費的時間與精力。除此之外,許多雲端服務供應商也以類似函式庫的方式提供跨平台支援的工具,這對開發者來說,是非常大的助益。
另外,還有許多專精於特定用途的函式庫,例如專門處理自然語言的NLTK(natural language toolkit),或是應用於機器學習的 scikit-learn,都可以透過Python來操作。
除此之外,還有許多函式庫與框架可以透過Python處裡,例如:
- 適用於繪製圖表的matplotib
- 適用於工程應用、科學和數學的SciPy
- 適用於HTML解析和XML的BeautifulSoup
- 適用於科學計算的NumPy
- 適用於服務器端Web開發的Django
理由四:多功能、可靠性與速度
若是詢問任何一位使用Python寫程式的開發人員,他們會完全同意Python是一個可靠的工具,而且比大多數市面上的程式語言還要快速。Python幾乎可以在任何類型的環境中使用,而且無論使用哪種平台,幾乎不會遇到任何效能損失的問題。
談到Python的多功能性,它可以在多種環境中使用,例如移動應用程式、電腦應用程式、網頁開發,以及硬體程式等。也因為它擁有大量的應用程式,Python的多功能性對使用者來說更具吸引力。
理由五:大數據、機器學習與雲端運算
雲端運算、機器學習和大數據是今天電腦科學界最熱門的趨勢,它們可以幫助許多企業改變和優化工作流程。相較於R語言,Python被認為更具通用性,成為數據科學和分析最受歡迎的工具,目前許多企業進行數據處理、分析的工作,都是以Python來進行。
不僅如此,每天都有成千上萬的機器學習專案正在使用數百個Python函式庫,例如用於神經網路的TensorFlow和用於電腦視覺OpenCV等。
人人學Python已經是未來的趨勢,它的易用性、多功能與廣泛應用,賦予許多非本科系的學生、白領工作者握有進入人工智慧領域的鑰匙。因此專家也建議,培養與機器對話的能力,不論未來機器人如何發展,都有十足的信心不被取代,而且如虎添翼。
2021年12月30日 星期四
Python 教學
Python 說明文件內容 — Python 3.8.12 說明文件
瀏覽
- 索引
- 模組 |
- 下一頁 |

- Python »
- 3.8.12 Documentation »
-
|
Python 說明文件內容¶
- Python 有什麼新功能?
- Python 3.8 有什么新变化
- 摘要 - 发布重点
- 新的特性
- 其他语言特性修改
- 新增模块
- 改进的模块
- ast
- asyncio
- builtins
- collections
- cProfile
- csv
- curses
- ctypes
- datetime
- functools
- gc
- gettext
- gzip
- IDLE 与 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
- 性能优化
- 构建和 C API 的改变
- 弃用
- API 与特性的移除
- 移植到 Python 3.8
- Python 3.8.1 中的重要变化
- Python 3.8.2 中的重要变化
- Python 3.8.3 中的重要变化
- Python 3.8.8 中的重要变化
- Python 3.8.9 中的重要变化
- Python 3.8.10 中的重要变化
- Python 3.8.10 中的重要变化
- Notable changes in Python 3.8.12
- Python 3.7 有什么新变化
- 摘要 - 发布重点
- 新的特性
- 其他语言特性修改
- 新增模块
- 改进的模块
- 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 与 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 的改变
- 构建的改变
- 性能优化
- 其他 CPython 实现的改变
- 已弃用的 Python 行为
- 已弃用的 Python 模块、函数和方法
- 已弃用的 C API 函数和类型
- 平台支持的移除
- API 与特性的移除
- 移除的模块
- Windows 专属的改变
- 移植到 Python 3.7
- Python 3.7.1 中的重要变化
- Python 3.7.2 中的重要变化
- Python 3.7.6 中的重要变化
- Python 3.7.10 中的重要变化
- Python 3.6 有什么新变化
- 摘要 - 发布重点
- 新的特性
- PEP 498: 格式化的字符串文字
- PEP 526: 变量注释的语法
- PEP 515: 数字文字中的下划线。
- PEP 525: 异步生成器
- PEP 530: 异步推导
- PEP 487: 自定义类创建
- PEP 487: 描述器协议的增强
- PEP 519: 添加文件系统路径协议
- PEP 495: 消除本地时间的歧义
- PEP 529: 将Windows文件系统编码更改为UTF-8
- PEP 528: 将Windows控制台编码更改为UTF-8
- PEP 520: 保留类属性定义顺序
- PEP 468: 保留关键字参数顺序
- 新的 dict 实现
- PEP 523: 向CPython 添加框架评估API
- PYTHONMALLOC 环境变量
- DTrace 和 SystemTap 探测支持
- 其他语言特性修改
- 新增模块
- 改进的模块
- array
- ast
- asyncio
- binascii
- cmath
- collections
- concurrent.futures
- contextlib
- datetime
- decimal
- distutils
- encodings
- enum
- faulthandler
- fileinput
- hashlib
- http.client
- idlelib 与 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
- 回溯
- tracemalloc
- typing
- unicodedata
- unittest.mock
- urllib.request
- urllib.robotparser
- venv
- warnings
- winreg
- winsound
- xmlrpc.client
- zipfile
- zlib
- 性能优化
- 构建和 C API 的改变
- 其他改进
- 弃用
- 移除
- 移植到Python 3.6
- Python 3.6.2 中的重要变化
- Python 3.6.4 中的重要变化
- Python 3.6.5 中的重要变化
- Python 3.6.7 中的重要变化
- Python 3.6.10 中的重要变化
- Notable changes in Python 3.6.13
- Python 3.5 有什麼新功能
- 摘要 - 发布重点
- 新的特性
- PEP 492 - 使用 async 和 await 语法实现协程
- PEP 465 - 用于矩阵乘法的专用中缀运算符
- PEP 448 - Additional Unpacking Generalizations
- PEP 461 - percent formatting support for bytes and bytearray
- PEP 484 - 类型提示
- 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 与 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
- 回溯
- types
- unicodedata
- unittest
- unittest.mock
- urllib
- wsgiref
- xmlrpc
- xml.sax
- zipfile
- 其他模块级更改
- 性能优化
- 构建和 C API 的改变
- 弃用
- 移除
- 移植到Python 3.5
- Python 3.5.4 的显著变化
- Python 3.4 有什么新变化
- 摘要 - 发布重点
- 新的特性
- 新增模块
- 改进的模块
- 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
- 回溯
- types
- urllib
- unittest
- venv
- wave
- weakref
- xml.etree
- zipfile
- CPython Implementation Changes
- 弃用
- 移除
- 移植到 Python 3.4
- 3.4.3 的变化
- Python 3.3 有什么新变化
- 摘要 - 发布重点
- PEP 405: 虚拟环境
- PEP 420: 隐式命名空间包
- PEP 3118: 新的内存视图实现和缓冲协议文档
- PEP 393: 灵活的字符串表示
- PEP 397: 适用于Windows的Python启动器
- PEP 3151: 重写 OS 和 IO 异常的层次结构
- PEP 380: 委托给子生成器的语法
- PEP 409: 清除异常上下文
- PEP 414: 显式的Unicode文本
- PEP 3155: 类和函数的限定名称
- PEP 412: Key-Sharing Dictionary
- PEP 362: 函数签名对象
- PEP 421: 添加 sys.implementation
- Using importlib as the Implementation of Import
- 其他语言特性修改
- A Finer-Grained Import Lock
- Builtin functions and types
- 新增模块
- 改进的模块
- 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: 定义稳定的ABI
- PEP 389: Argparse 命令行解析模块
- PEP 391: 基于字典的日志配置
- PEP 3148:
concurrent.futures模块 - PEP 3147: PYC 仓库目录
- PEP 3149: ABI Version Tagged .so Files
- PEP 3333: Python Web服务器网关接口v1.0.1
- 其他语言特性修改
- 新增,改进和弃用的模块
- 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
- 多线程
- 性能优化
- Unicode
- 编解码器
- 文档
- IDLE
- 代码库
- 构建和 C API 的改变
- 移植到 Python 3.2
- Python 3.1 有什么新变化
- Python 3.0 有什么新变化
- Python 2.7 有什么新变化
- Python 2.x的未来
- Changes to the Handling of Deprecation Warnings
- Python 3.1 Features
- PEP 372: Adding an Ordered Dictionary to collections
- PEP 378: 千位分隔符的格式说明符
- 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
- 其他语言特性修改
- 新增和改进的模块
- 构建和 C API 的改变
- Other Changes and Fixes
- 移植到 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:适用于Python 2.7 的 HTTPS 验证迁移工具
- New
make regen-allbuild target - Removal of
make touchbuild target
- 致谢
- Python 2.6 有什么新变化
- Python 3.0
- 开发过程的变化
- PEP 343: "with" 语句
- PEP 366: 从主模块显式相对导入
- PEP 370: 分用户的 site-packages 目录
- PEP 371: 多任务处理包
- PEP 3101: 高级字符串格式
- PEP 3105:
print改为函数 - PEP 3110: 异常处理的变更
- PEP 3112: 字节字面值
- PEP 3116: 新 I/O 库
- PEP 3118: 修改缓冲区协议
- PEP 3119: 抽象基类
- PEP 3127: 整型文字支持和语法
- PEP 3129: 类装饰器
- PEP 3141: A Type Hierarchy for Numbers
- 其他语言特性修改
- 新增和改进的模块
- Deprecations and Removals
- 构建和 C API 的改变
- 移植到Python 2.6
- 致谢
- Python 2.5 有什么新变化
- Python 2.4 有什么新变化
- PEP 218: 内置集合对象
- PEP 237: 统一长整数和整数
- PEP 289: 生成器表达式
- PEP 292: Simpler String Substitutions
- PEP 318: Decorators for Functions and Methods
- PEP 322: 反向迭代
- PEP 324: 新的子进程模块
- PEP 327: 十进制数据类型
- PEP 328: 多行导入
- PEP 331: Locale-Independent Float/String Conversions
- 其他语言特性修改
- 新增,改进和弃用的模块
- 构建和 C API 的改变
- 移植到 Python 2.4
- 致谢
- Python 2.3 有什么新变化
- PEP 218: A Standard Set Datatype
- PEP 255: Simple Generators
- PEP 263: Source Code Encodings
- PEP 273: 从ZIP压缩包导入模块
- PEP 277: Unicode file name support for Windows NT
- PEP 278: 通用换行支持
- PEP 279: enumerate()
- PEP 282: logging 包
- PEP 285: 布尔类型
- PEP 293: Codec Error Handling Callbacks
- PEP 301: Distutils的软件包索引和元数据
- PEP 302: New Import Hooks
- PEP 305: 逗号分隔文件
- PEP 307: Pickle Enhancements
- 扩展切片
- 其他语言特性修改
- 新增,改进和弃用的模块
- Pymalloc: A Specialized Object Allocator
- 构建和 C API 的改变
- Other Changes and Fixes
- 移植到 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
- 新增和改进的模块
- Other Changes and Fixes
- 致谢
- Python 2.0 有什么新变化
- Changelog(更動日誌)
- Python 3.8.12 final
- Python 3.8.11 final
- Python 3.8.10 final
- Python 3.8.9 final
- Python 3.8.8 final
- Python 3.8.8 rc1
- Python 3.8.7 final
- Python 3.8.7 release candidate 1
- Python 3.8.6 final
- Python 3.8.6 release candidate 1
- Python 3.8.5 final
- Python 3.8.4 final
- Python 3.8.4 release candidate 1
- Python 3.8.3 final
- Python 3.8.3 release candidate 1
- Python 3.8.2 正式版
- Python 3.8.2 rc2
- Python 3.8.2 rc1
- Python 3.8.1 正式版
- Python 3.8.1 rc1
- Python 3.8.0 正式版
- Python 3.8.0 rc1
- Python 3.8.0 beta 4
- Python 3.8.0 beta 3
- Python 3.8.0 beta 2
- 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 正式版
- Python 3.7.0 rc1
- 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 正式版
- Python 3.6.6 rc1
- Python 3.6.5 正式版
- Python 3.6.5 rc1
- Python 3.6.4 正式版
- Python 3.6.4 rc1
- Python 3.6.3 正式版
- Python 3.6.3 rc1
- Python 3.6.2 正式版
- Python 3.6.2 rc2
- Python 3.6.2 rc1
- Python 3.6.1 正式版
- Python 3.6.1 rc1
- Python 3.6.0 正式版
- Python 3.6.0 rc2
- Python 3.6.0 rc1
- 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 正式版
- Python 3.5.5 rc1
- Python 3.5.4 正式版
- Python 3.5.4 rc1
- Python 3.5.3 正式版
- Python 3.5.3 rc1
- Python 3.5.2 正式版
- Python 3.5.2 rc1
- Python 3.5.1 正式版
- Python 3.5.1 rc1
- Python 3.5.0 正式版
- Python 3.5.0 rc4
- Python 3.5.0 rc3
- Python 3.5.0 rc2
- Python 3.5.0 rc1
- 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 3.8 有什么新变化
- Python 教學
- 1. 淺嘗滋味
- 2. 使用 Python 直譯器
- 3. 一個非正式的 Python 簡介
- 4. 深入了解流程控制
- 5. 資料結構
- 6. 模組
- 7. 輸入和輸出
- 8. 錯誤和例外
- 9. 类
- 10. Python 標準函式庫概覽
- 11. 标准库简介 —— 第二部分
- 12. 虛擬環境與套件
- 13. 現在可以來學習些什麼?
- 14. 交互式编辑和编辑历史
- 15. 浮點數運算:問題與限制
- 16. 附錄
- Python安装和使用
- Python语言参考
- 1. 簡介
- 2. 词法分析
- 3. 数据模型
- 4. 执行模型
- 5. 导入系统
- 6. 表达式
- 7. 简单语句
- 8. 复合语句
- 9. 最高层级组件
- 10. 完整的語法規格書
- Python 標準函式庫 (Standard Library)
- 簡介
- 內建函式
- 內建常數
- 內建型態
- 內建的例外
- 文本处理服务
- 二进制数据服务
- 数据类型
datetime--- 基本的日期和时间类型calendar--- 日历相关函数collections--- 容器資料型態collections.abc--- 容器的抽象基类heapq--- 堆積佇列 (heap queue) 演算法bisect--- 陣列二分演算法 (Array bisection algorithm)array--- 高效率的數值型態陣列weakref--- 弱引用types--- 动态类型创建和内置类型名称copy--- 浅层 (shallow) 和深层 (deep) 复制操作pprint--- 数据美化输出reprlib--- 另一种repr()实现enum--- 对枚举的支持
- 數值與數學模組
- 函式編程模組
- 檔案與目錄存取
- 数据持久化
- 資料壓縮與保存
- 檔案格式
- 加密服务
- 通用操作系统服务
os--- 多种操作系统接口io--- 处理流的核心工具time--- 时间的访问和转换argparse--- 命令行选项、参数和子命令解析器getopt--- C 风格的命令行选项解析器logging--- Python 的日志记录工具logging.config--- 日志记录配置logging.handlers--- 日志处理getpass--- 便携式密码输入工具curses--- 终端字符单元显示的处理curses.textpad--- 用于 curses 程序的文本输入控件curses.ascii--- 用于 ASCII 字符的工具curses.panel--- curses 的 panel 栈扩展platform--- 获取底层平台的标识数据errno--- 标准 errno 系统符号ctypes--- Python 的外部函数库
- 并发执行
threading--- 基于线程的并行multiprocessing--- 基于进程的并行multiprocessing.shared_memory--- 可从进程直接访问的共享内存concurrent包concurrent.futures--- 启动并行任务subprocess--- 子进程管理sched--- 事件调度器queue--- 一个同步的队列类contextvars上下文变量_thread--- 底层多线程 API_dummy_thread---_thread的替代模块dummy_threading--- 可直接替代threading模块。
- 网络和进程间通信
- 互联网数据处理
email--- 电子邮件与 MIME 处理包email.message: 表示一封电子邮件信息email.parser: 解析电子邮件信息email.generator: 生成 MIME 文档email.policy: 策略对象email.errors: 异常和缺陷类email.headerregistry: 自定义标头对象email.contentmanager: 管理 MIME 内容email: 示例email.message.Message: 使用compat32API 来表示电子邮件消息email.mime: 从头创建电子邮件和 MIME 对象email.header: 国际化标头email.charset: 表示字符集email.encoders: 编码器email.utils: 其他工具email.iterators: 迭代器
json--- JSON 编码和解码器mailcap--- Mailcap 文件处理mailbox--- 操作多种格式的邮箱mimetypes--- 映射文件夹到 MIME 类型base64—— Base16、Base32、Base64、Base85 資料編碼binhex--- 对binhex4文件进行编码和解码binascii--- 二进制和 ASCII 码互转quopri--- 编码与解码经过 MIME 转码的可打印数据uu--- 对 uuencode 文件进行编码与解码
- 结构化标记处理工具
html--- 超文本标记语言支持html.parser--- 简单的 HTML 和 XHTML 解析器html.entities--- HTML 一般实体的定义- XML 處理模組
xml.etree.ElementTree--- ElementTree XML APIxml.dom--- 文档对象模型 APIxml.dom.minidom--- 最小化的 DOM 实现xml.dom.pulldom--- 支持构建部分 DOM 树xml.sax--- 支持 SAX2 解析器xml.sax.handler--- SAX 处理程序的基类xml.sax.saxutils--- SAX 工具集xml.sax.xmlreader--- 用于 XML 解析器的接口xml.parsers.expat--- Fast XML parsing using Expat
- 互联网协议和支持
webbrowser--- 方便的Web浏览器控制器cgi--- Common Gateway Interface supportcgitb--- 用于 CGI 脚本的回溯管理器wsgiref--- WSGI Utilities and Reference Implementationurllib--- URL 处理模块urllib.request--- 用于打开 URL 的可扩展库- Request 对象
- OpenerDirector 对象
- BaseHandler 对象
- HTTPRedirectHandler 对象
- HTTPCookieProcessor 对象
- ProxyHandler 对象
- HTTPPasswordMgr 对象
- HTTPPasswordMgrWithPriorAuth 对象
- AbstractBasicAuthHandler 对象
- HTTPBasicAuthHandler 对象
- ProxyBasicAuthHandler 对象
- AbstractDigestAuthHandler 对象
- HTTPDigestAuthHandler 对象
- ProxyDigestAuthHandler 对象
- HTTPHandler 对象
- HTTPSHandler 对象
- FileHandler 对象
- DataHandler 对象
- FTPHandler 对象
- CacheFTPHandler 对象
- UnknownHandler 对象
- HTTPErrorProcessor 对象
- 例子
- Legacy interface
urllib.requestRestrictions
urllib.response--- urllib 使用的 Response 类urllib.parse用于解析 URLurllib.error--- urllib.request 引发的异常类urllib.robotparser--- robots.txt 语法分析程序http--- HTTP 模块http.client--- HTTP 协议客户端ftplib--- FTP 协议客户端poplib--- POP3 协议客户端imaplib--- IMAP4 协议客户端nntplib--- NNTP protocol clientsmtplib---SMTP协议客户端smtpd--- SMTP 服务器telnetlib-- Telnet 客户端uuid--- UUID objects according to RFC 4122socketserver--- A framework for network servershttp.server--- HTTP 服务器http.cookies--- HTTP状态管理http.cookiejar—— HTTP 客户端的 Cookie 处理xmlrpc--- XMLRPC 服务端与客户端模块xmlrpc.client--- XML-RPC 客户端访问xmlrpc.server--- 基本 XML-RPC 服务器ipaddress--- IPv4/IPv6 操作库
- 多媒体服务
- 國際化
- 程式框架
- 以 Tk 打造 GUI
tkinter--- Tcl/Tk的Python接口tkinter.ttk--- Tk主题小部件tkinter.tix--- Extension widgets for Tktkinter.scrolledtext--- 滚动文字控件- IDLE
- 其它的 GUI
- 開發工具
typing--- 类型标注支持pydoc--- 文档生成器和在线帮助系统doctest--- 测试交互性的Python示例unittest--- 單元測試框架unittest.mock--- 模拟对象库unittest.mock上手指南- 使用 mock
- 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
- 2to3 - 自動將 Python 2的程式碼轉成 Python 3
test--- Python回归测试包test.support--- Utilities for the Python test suitetest.support.script_helper--- Utilities for the Python execution tests
- 调试和分析
- 軟體封裝與發布
- Python运行时服务
sys--- 系统相关的参数和函数sysconfig--- Provide access to Python's configuration informationbuiltins--- 内建对象__main__--- 顶层脚本环境warnings--- Warning controldataclasses--- 数据类contextlib--- 为with语句上下文提供的工具abc--- 抽象基类atexit--- 退出处理器traceback--- 打印或检索堆栈回溯__future__--- Future 语句定义gc--- 垃圾回收器接口inspect--- 检查对象site—— 指定域的配置钩子
- 自定义 Python 解释器
- 匯入模組
zipimport--- 从 Zip 存档中导入模块pkgutil--- 包扩展工具modulefinder--- 查找脚本使用的模块runpy--- Locating and executing Python modulesimportlib---import的实现- Using
importlib.metadata
- Python 语言服务
parser--- 访问 Python 解析树ast--- 抽象语法树symtable--- Access to the compiler's symbol tablessymbol--- 与 Python 解析树一起使用的常量token--- 与Python解析树一起使用的常量keyword--- 检验Python关键字tokenize--- 对 Python 代码使用的标记解析器tabnanny--- 模糊缩进检测pyclbr--- Python 模块浏览器支持py_compile--- 编译 Python 源文件compileall--- Byte-compile Python librariesdis--- Python bytecode的反組譯器pickletools--- pickle 开发者工具集
- 杂项服务
- Windows系统相关模块
- Unix 专有服务
posix--- 最常见的 POSIX 系统调用pwd--- 用户密码数据库spwd--- The shadow password databasegrp--- 组数据库crypt--- Function to check Unix passwordstermios--- POSIX 风格的 tty 控制tty--- 终端控制功能pty--- 伪终端工具fcntl--- Thefcntlandioctlsystem callspipes--- 终端管道接口resource--- Resource usage informationnis--- Sun 的 NIS (黄页) 接口- Unix syslog 库例程
- 被取代的模块
optparse--- 解析器的命令行选项- 背景
- 教程
- 参考指南
- 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
imp--- Access the import internals
- 未创建文档的模块
- 扩展和嵌入 Python 解释器
- Python / C API 參考手冊
- 簡介
- 稳定的应用程序二进制接口
- The Very High Level Layer
- 參照計數
- 例外處理
- 工具
- 抽象物件層
- 具体的对象层
- 初始化,终结和线程
- Python初始化配置
- 記憶體管理
- 对象实现支持
- API 和 ABI 版本管理
- 發布 Python 模組
- 安裝 Python 模組
- Python 常用指引
- Python 2 的程式碼移植到Python 3
- 簡短的說明
- 詳細的
- 向下支援Python 2.6和更舊的版本
- Make sure you specify the proper version support in your
setup.pyfile - 有好的測試覆蓋率
- 瞭解Python 2 & 3的差異
- 更新你的程式碼
- Prevent compatibility regressions
- Check which dependencies block your transition
- Update your
setup.pyfile to denote Python 3 compatibility - Use continuous integration to stay compatible
- 考虑使用可选的静态类型检查
- 遷移延伸模組到 Python 3
- 用 Python 进行 Curses 编程
- 修飾器 HowTo 指南
- 函式編程 HOWTO
- 如何使用 Logging 模組
- 日志操作手册
- 在多个模块中记录日志
- 在多个线程中记录日志
- 多个日志处理器以及多种格式化器
- 在多个地方记录日志
- 日志服务器配置示例
- 处理日志处理器的阻塞
- 通过网络发送和接收日志
- 在日志记录中添加上下文信息
- 从多个进程记录至单个文件
- 轮换日志文件
- 使用其他日志格式化方式
- 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
- 缓冲日志消息并有条件地输出它们
- 通过配置使用UTC (GMT) 格式化时间
- 使用上下文管理器的可选的日志记录
- A CLI application starter template
- A Qt GUI for logging
- 如何使用正規表達式
- 套接字编程指南
- 如何排序
- Unicode 指南
- 如何使用urllib套件取得網路資源
- Argparse 教學
- ipaddress模組介紹
- Argument Clinic How-To
- The Goals Of Argument Clinic
- Basic Concepts And Usage
- Converting Your First Function
- Advanced Topics
- Symbolic default values
- Renaming the C functions and variables generated by Argument Clinic
- Converting functions using PyArg_UnpackTuple
- Optional Groups
- Using real Argument Clinic converters, instead of "legacy converters"
- Py_buffer
- Advanced converters
- Parameter default values
- The
NULLdefault value - Expressions specified as default values
- Using a return converter
- Cloning existing functions
- Calling Python code
- Using a "self converter"
- Writing a custom converter
- Writing a custom return converter
- METH_O and METH_NOARGS
- tp_new and tp_init functions
- Changing and redirecting Clinic's output
- The #ifdef trick
- Using Argument Clinic in Python files
- 使用 DTrace 和 SystemTap 检测CPython
- Python 2 的程式碼移植到Python 3
- Python 常見問題
- 常見Python問答集
- 程式開發常見問答集
- 设计和历史常见问题
- 为什么Python使用缩进来分组语句?
- 为什么简单的算术运算得到奇怪的结果?
- 為何浮點數運算如此不精確?
- 為何Python字串為不可變動
- 为什么必须在方法定义和调用中显式使用“self”?
- 为什么不能在表达式中赋值?
- 为什么Python对某些功能(例如list.index())使用方法来实现,而其他功能(例如len(List))使用函数实现?
- 为什么 join()是一个字符串方法而不是列表或元组方法?
- 异常有多快?
- 为什么Python中没有switch或case语句?
- 难道不能在解释器中模拟线程,而非得依赖特定于操作系统的线程实现吗?
- 為何lambda表示式不能包含在敘述內
- Python可以被編譯成機器語言或C語言或其他種語言嗎?
- Python如何管理記憶體?
- 為何CPython不使用更多傳統的垃圾回收機制?
- 當CPython結束時,為何所有的記憶體不會被釋放?
- 为什么有单独的元组和列表数据类型?
- 列表是如何在CPython中实现的?
- 字典是如何在CPython中实现的?
- 为什么字典key必须是不可变的?
- 為何list.sort()不是回傳排序過的串列?
- 如何在Python中指定和实施接口规范?
- 為何沒有goto語法?
- 为什么原始字符串(r-strings)不能以反斜杠结尾?
- 为什么Python没有属性赋值的“with”语句?
- 为什么 if/while/def/class语句需要冒号?
- 为什么Python在列表和元组的末尾允许使用逗号?
- 函式庫和擴充功能的常見問題
- 扩展/嵌入常见问题
- 可以使用 C 语言创建自己的函数吗?
- 可以使用 C++ 语言创建自己的函数吗?
- C很难写,有没有其他选择?
- 如何在 C 中执行任意 Python 语句?
- 如何在 C 中对任意 Python 表达式求值?
- 如何从Python对象中提取C的值?
- 如何使用Py_BuildValue()创建任意长度的元组?
- 如何从C调用对象的方法?
- 如何捕获PyErr_Print()(或打印到stdout / stderr的任何内容)的输出?
- 如何从C访问用Python编写的模块?
- 如何在 Python 中对接 C ++ 对象?
- 我使用Setup文件添加了一个模块,为什么make失败了?
- 如何调试扩展?
- 我想在Linux系统上编译一个Python模块,但是缺少一些文件。为什么?
- 如何区分“输入不完整”和“输入无效”?
- 如何找到未定义的g++符号__builtin_new或__pure_virtual?
- 能否创建一个对象类,其中部分方法在C中实现,而其他方法在Python中实现(例如通过继承)?
- FAQ:在 Windows 使用 Python
- 圖形化使用者界面常見問答集
- 為什麼Python被安裝在我的機器上?常見問答集
- 术语对照表
- 關於這些說明文件
- 處理 Bug
- 版權宣告
- 歷史與授權
瀏覽
- 索引
- 模組 |
- 下一頁 |

- Python »
- 3.8.12 Documentation »
-
|
The Python Software Foundation is a non-profit corporation. Please donate.
最後更新於 9月 08, 2021。 Found a bug?
Created using Sphinx 2.4.4.
-
Python/第一次用就上手 - Python Taiwan Wiki 登入 搜尋: Python / 第一次用就上手 最新更動 尋找頁面 PotWiki/慣...
-
Python 教學 Python 教學共有 190 多篇 Python 教學,包含基本語法、函式庫、網路爬蟲和一系列由淺入深的精選範例,不僅能對 Python 有充分的認識,還能透過 Python 做出各種有趣的應用! 點選 左側選單 可以查看所有文章 ( 行動裝置可點選 ...
-
NumPy 教程 NumPy(Numerical Python) 是 Python 語言的一個擴展程序庫,支持大量的維度數組與矩陣運算,此外也針對數組運算提供大量的數學函數庫。 NumPy 的前身 Numeric 最早是由 Jim Hugunin 與其它協作者共同開發,200...