
Generic Operating System Services
*********************************

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`` --- Miscellaneous operating system interfaces
  * Process Parameters
  * File Object Creation
  * File Descriptor Operations
    * ``open()`` flag constants
  * Files and Directories
  * Process Management
  * Miscellaneous System Information
  * Miscellaneous Functions
* ``io`` --- Core tools for working with streams
  * Module Interface
  * I/O Base Classes
  * Raw File I/O
  * Buffered Streams
  * Text I/O
  * Advanced topics
    * Performance
      * Binary I/O
      * Text I/O
    * Multi-threading
    * Reentrancy
* ``time`` --- Time access and conversions
* ``argparse`` --- Parser for command-line options, arguments and sub-
  commands
  * Example
    * Creating a parser
    * Adding arguments
    * Parsing arguments
  * ArgumentParser objects
    * description
    * epilog
    * add_help
    * prefix_chars
    * fromfile_prefix_chars
    * argument_default
    * parents
    * formatter_class
    * conflict_handler
    * prog
    * usage
  * The add_argument() method
    * name or flags
    * action
    * nargs
    * const
    * default
    * type
    * choices
    * required
    * help
    * metavar
    * dest
  * The parse_args() method
    * Option value syntax
    * Invalid arguments
    * Arguments containing ``"-"``
    * Argument abbreviations
    * 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
  * Upgrading optparse code
* ``optparse`` --- Parser for command line options
  * Background
    * Terminology
    * What are options for?
    * What are positional arguments for?
  * Tutorial
    * Understanding option actions
    * The store action
    * Handling boolean (flag) options
    * Other actions
    * Default values
    * Generating help
      * Grouping Options
    * Printing a version string
    * How ``optparse`` handles errors
    * Putting it all together
  * Reference Guide
    * Creating the parser
    * Populating the parser
    * Defining options
    * Option attributes
    * Standard option actions
    * Standard option types
    * Parsing arguments
    * Querying and manipulating your option parser
    * Conflicts between options
    * Cleanup
    * Other methods
  * 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``
    * Adding new types
    * Adding new actions
* ``getopt`` --- C-style parser for command line options
* ``logging`` --- Logging facility for Python
  * Logger Objects
  * Handler Objects
  * Formatter Objects
  * Filter Objects
  * LogRecord Objects
  * LogRecord attributes
  * LoggerAdapter Objects
  * Thread Safety
  * Module-Level Functions
  * Integration with the warnings module
* ``logging.config`` --- Logging configuration
  * Configuration functions
  * Configuration dictionary schema
    * Dictionary Schema Details
    * Incremental Configuration
    * Object connections
    * User-defined objects
    * Access to external objects
    * Access to internal objects
  * Configuration file format
* ``logging.handlers`` --- Logging handlers
  * StreamHandler
  * FileHandler
  * NullHandler
  * WatchedFileHandler
  * RotatingFileHandler
  * TimedRotatingFileHandler
  * SocketHandler
  * DatagramHandler
  * SysLogHandler
  * NTEventLogHandler
  * SMTPHandler
  * MemoryHandler
  * HTTPHandler
* ``getpass`` --- Portable password input
* ``curses`` --- Terminal handling for character-cell displays
  * Functions
  * Window Objects
  * Constants
* ``curses.textpad`` --- Text input widget for curses programs
  * Textbox objects
* ``curses.wrapper`` --- Terminal handler for curses programs
* ``curses.ascii`` --- Utilities for ASCII characters
* ``curses.panel`` --- A panel stack extension for curses
  * Functions
  * Panel Objects
* ``platform`` ---  Access to underlying platform's identifying data
  * Cross Platform
  * Java Platform
  * Windows Platform
    * Win95/98 specific
  * Mac OS Platform
  * Unix Platforms
* ``errno`` --- Standard errno system symbols
* ``ctypes`` --- A foreign function library for Python
  * ctypes tutorial
    * Loading dynamic link libraries
    * Accessing functions from loaded dlls
    * Calling functions
    * Fundamental data types
    * Calling functions, continued
    * Calling functions with your own custom data types
    * 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
    * Fundamental data types
    * Structured data types
    * Arrays and pointers