通用操作系统服务
****************

本章中描述的各模块提供了在（几乎）所有的操作系统上可用的操作系统特性的
接口，例如文件和时钟。这些接口通常以 Unix 或 C 接口为参照对象设计，不
过在大多数其他系统上也可用。这里有一个概述：

* "os" --- 操作系统接口模块

  * 文件名，命令行参数，以及环境变量。

  * 进程参数

  * 创建文件对象

  * 文件描述符操作

    * Querying the size of a terminal

    * Inheritance of File Descriptors

  * Files and Directories

    * Linux extended attributes

  * Process Management

  * Interface to the scheduler

  * Miscellaneous System Information

  * Random numbers

* "io" --- 处理流的核心工具

  * 概述

    * Text I/O

    * Binary I/O

    * Raw I/O

  * High-level Module Interface

    * In-memory streams

  * Class hierarchy

    * I/O Base Classes

    * Raw File I/O

    * Buffered Streams

    * Text I/O

  * 性能

    * Binary I/O

    * Text I/O

    * 多线程

    * Reentrancy

* "time" --- 时间的访问和转换

  * 函数

  * Clock ID 常量

  * 时区常量

* "argparse" --- 命令行选项、参数和子命令解析器

  * 示例

    * 创建一个解析器

    * 添加参数

    * 解析参数

  * ArgumentParser 对象

    * prog

    * usage

    * description

    * epilog

    * parents

    * formatter_class

    * prefix_chars

    * fromfile_prefix_chars

    * argument_default

    * allow_abbrev

    * conflict_handler

    * add_help

  * add_argument() 方法

    * name or flags

    * action

    * nargs

    * const

    * default

    * type

    * 选择

    * required

    * help

    * metavar

    * dest

    * Action classes

  * The parse_args() method

    * Option value syntax

    * Invalid arguments

    * Arguments containing "-"

    * Argument abbreviations (prefix matching)

    * Beyond "sys.argv"

    * The Namespace object

  * Other utilities

    * Sub-commands

    * FileType objects

    * Argument groups

    * Mutual exclusion

    * Parser defaults

    * Printing help

    * Partial parsing

    * Customizing file parsing

    * Exiting methods

    * Intermixed parsing

  * Upgrading optparse code

* "getopt" --- C-style parser for command line options

* 模块 "logging" --- Python 的日志记录工具

  * Logger 对象

  * 日志级别

  * Handler Objects

  * Formatter Objects

  * Filter Objects

  * LogRecord Objects

  * LogRecord attributes

  * LoggerAdapter Objects

  * 线程安全

  * 模块级别函数

  * Module-Level Attributes

  * Integration with the warnings module

* "logging.config" --- 日志记录配置

  * Configuration functions

  * Configuration dictionary schema

    * Dictionary Schema Details

    * Incremental Configuration

    * Object connections

    * User-defined objects

    * Access to external objects

    * Access to internal objects

    * Import resolution and custom importers

  * Configuration file format

* "logging.handlers" --- Logging handlers

  * StreamHandler

  * FileHandler

  * NullHandler

  * WatchedFileHandler

  * BaseRotatingHandler

  * RotatingFileHandler

  * TimedRotatingFileHandler

  * SocketHandler

  * DatagramHandler

  * SysLogHandler

  * NTEventLogHandler

  * SMTPHandler

  * MemoryHandler

  * HTTPHandler

  * QueueHandler

  * QueueListener

* "getpass" --- 便携式密码输入工具

* "curses" --- 终端字符单元显示的处理

  * 函数

  * Window Objects

  * 常量

* "curses.textpad" --- Text input widget for curses programs

  * 文本框对象

* "curses.ascii" --- Utilities for ASCII characters

* "curses.panel" --- A panel stack extension for curses

  * 函数

  * Panel Objects

* "platform" ---  获取底层平台的标识数据

  * 跨平台

  * Java平台

  * Windows平台

  * Mac OS平台

  * Unix Platforms

* "errno" --- Standard errno system symbols

* "ctypes" --- Python 的外部函数库

  * ctypes 教程

    * 载入动态连接库

    * 操作导入的动态链接库中的函数

    * 调用函数

    * 基础数据类型

    * 调用函数，继续

    * 使用自定义的数据类型调用函数

    * 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

    * Data types

    * 基础数据类型

    * Structured data types

    * Arrays and pointers
