The modules described in this chapter provide interfaces to operating system features that are available on (almost) all operating systems, such as files and a clock. The interfaces are generally modeled after the Unix or C interfaces, but they are available on most other systems as well. Here’s an overview:
os
— 杂项操作系统接口
io
— 用于处理流的核心工具
time
— 时间的访问和转换
argparse
— 用于命令行选项、自变量及子命令的剖析器
getopt
— 用于命令行选项的 C 样式剖析器
logging
— 用于的 Python 日志设施
logging.config
— 日志配置
logging.handlers
— 日志处理程序
getpass
— 便携式口令输入
curses
— 用于字符单元显示的终端处理
curses.textpad
— 用于 curses 程序的文本输入 Widget
curses.ascii
— 用于 ASCII 字符的实用程序
curses.panel
— 用于 curses 的面板堆栈扩展
platform
— 访问底层平台的标识数据
errno
— 标准 errno 系统符号
ctypes
— 用于 Python 的外来函数库