16. 通用操作系统服务¶
本章中描述的各模块提供了在(几乎)所有的操作系统上可用的操作系统特性的接口,例如文件和时钟。这些接口通常以 Unix 或 C 接口为参照对象设计,不过在大多数其他系统上也可用。这里有一个概述:
- 16.1.
os
— 操作系统接口模块 - 16.2.
io
— 处理流的核心工具 - 16.3.
time
— 时间的访问和转换 - 16.4.
argparse
— 命令行选项、参数和子命令解析器 - 16.5.
getopt
— C-style parser for command line options - 16.6.
logging
— Logging facility for Python- 16.6.1. Logger Objects
- 16.6.2. 日志级别
- 16.6.3. Handler Objects
- 16.6.4. Formatter Objects
- 16.6.5. Filter Objects
- 16.6.6. LogRecord Objects
- 16.6.7. LogRecord attributes
- 16.6.8. LoggerAdapter Objects
- 16.6.9. 线程安全
- 16.6.10. 模块级别函数
- 16.6.11. Module-Level Attributes
- 16.6.12. Integration with the warnings module
- 16.7.
logging.config
— 日志记录配置 - 16.8.
logging.handlers
— Logging handlers- 16.8.1. StreamHandler
- 16.8.2. FileHandler
- 16.8.3. NullHandler
- 16.8.4. WatchedFileHandler
- 16.8.5. BaseRotatingHandler
- 16.8.6. RotatingFileHandler
- 16.8.7. TimedRotatingFileHandler
- 16.8.8. SocketHandler
- 16.8.9. DatagramHandler
- 16.8.10. SysLogHandler
- 16.8.11. NTEventLogHandler
- 16.8.12. SMTPHandler
- 16.8.13. MemoryHandler
- 16.8.14. HTTPHandler
- 16.8.15. QueueHandler
- 16.8.16. QueueListener
- 16.9.
getpass
— 便携式密码输入工具 - 16.10.
curses
— 终端字符单元显示的处理 - 16.11.
curses.textpad
— Text input widget for curses programs - 16.12.
curses.ascii
— Utilities for ASCII characters - 16.13.
curses.panel
— A panel stack extension for curses - 16.14.
platform
— Access to underlying platform’s identifying data - 16.15.
errno
— Standard errno system symbols - 16.16.
ctypes
— Python 的外部函数库- 16.16.1. ctypes 教程
- 16.16.1.1. 载入动态连接库
- 16.16.1.2. 操作导入的动态链接库中的函数
- 16.16.1.3. 调用函数
- 16.16.1.4. 基础数据类型
- 16.16.1.5. 调用函数,继续
- 16.16.1.6. 使用自定义的数据类型调用函数
- 16.16.1.7. Specifying the required argument types (function prototypes)
- 16.16.1.8. Return types
- 16.16.1.9. Passing pointers (or: passing parameters by reference)
- 16.16.1.10. Structures and unions
- 16.16.1.11. Structure/union alignment and byte order
- 16.16.1.12. Bit fields in structures and unions
- 16.16.1.13. Arrays
- 16.16.1.14. Pointers
- 16.16.1.15. Type conversions
- 16.16.1.16. Incomplete Types
- 16.16.1.17. Callback functions
- 16.16.1.18. Accessing values exported from dlls
- 16.16.1.19. Surprises
- 16.16.1.20. Variable-sized data types
- 16.16.2. ctypes reference
- 16.16.1. ctypes 教程