
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
  * 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
* ``time`` --- Time access and conversions
* ``optparse`` --- More powerful command line option parser
  * 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
    * 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`` --- Parser for command line options
* ``logging`` --- Logging facility for Python
  * Logging tutorial
    * Simple examples
    * Loggers
    * Handlers
    * Formatters
    * Configuring Logging
    * Configuring Logging for a Library
  * Logging Levels
  * Useful Handlers
  * Module-Level Functions
  * Logger Objects
  * Basic example
  * Logging to multiple destinations
  * Exceptions raised during logging
  * Adding contextual information to your logging output
  * Logging to a single file from multiple processes
  * Sending and receiving logging events across a network
  * Using arbitrary objects as messages
  * Optimization
  * Handler Objects
    * StreamHandler
    * FileHandler
    * WatchedFileHandler
    * RotatingFileHandler
    * TimedRotatingFileHandler
    * SocketHandler
    * DatagramHandler
    * SysLogHandler
    * NTEventLogHandler
    * SMTPHandler
    * MemoryHandler
    * HTTPHandler
  * Formatter Objects
  * Filter Objects
  * LogRecord Objects
  * LoggerAdapter Objects
  * Thread Safety
  * Configuration
    * Configuration functions
    * Configuration file format
    * Configuration server example
  * More examples
    * Multiple handlers and formatters
    * Using logging in multiple modules
* ``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