The modules described in this chapter provide a wide range of services related to the Python interpreter and its interaction with its environment. Here’s an overview:
sys
— 特定系统参数和函数
sysconfig
— 提供对 Python 配置信息的访问
builtins
— 内容对象
__main__
— 顶层脚本环境
warnings
— 警告控制
contextlib
— 实用程序为
with
语句上下文
__enter__
methods
__enter__
实现
try-finally
and flag variables
abc
— 抽象基类
atexit
— 退出处理程序
traceback
— 打印或检索堆栈回溯
__future__
— 未来的语句定义
gc
— 垃圾收集器接口
inspect
— 审查存活对象
site
— 特定站点配置挂钩
fpectl
— 浮点异常控制