15. Services génériques du système d’exploitation
*************************************************

Les modules documentés dans ce chapitre fournissent des interfaces
vers des fonctionnalités communes à la grande majorité des systèmes
d’exploitation, telles que les fichiers et l’horloge.  Bien que ces
interfaces soient classiquement calquées sur les interfaces Unix ou C,
elles sont aussi disponibles sur la plupart des autres systèmes. En
voici un aperçu.

* 15.1. "os" — Diverses interfaces pour le système d’exploitation

  * 15.1.1. Paramètres de processus

  * 15.1.2. Création de fichiers objets

  * 15.1.3. Opérations sur les descripteurs de fichiers

    * 15.1.3.1. "open()" flag constants

  * 15.1.4. Fichiers et répertoires

  * 15.1.5. Gestion des processus

  * 15.1.6. Diverses informations sur le système

  * 15.1.7. Diverses fonctions

* 15.2. "io" — Core tools for working with streams

  * 15.2.1. Module Interface

  * 15.2.2. I/O Base Classes

  * 15.2.3. Raw File I/O

  * 15.2.4. Buffered Streams

  * 15.2.5. Text I/O

  * 15.2.6. Advanced topics

    * 15.2.6.1. Performance

      * 15.2.6.1.1. Binary I/O

      * 15.2.6.1.2. Text I/O

    * 15.2.6.2. Fils d’exécution

    * 15.2.6.3. Reentrancy

* 15.3. "time" — Time access and conversions

* 15.4. "argparse" – Parseur d’arguments, d’options, et de sous-
  commandes de ligne de commande

  * 15.4.1. Exemple

    * 15.4.1.1. Créer un analyseur (*parser* en anglais)

    * 15.4.1.2. Ajouter des arguments

    * 15.4.1.3. Analyse des arguments

  * 15.4.2. Objets ArgumentParser

    * 15.4.2.1. prog

    * 15.4.2.2. usage

    * 15.4.2.3. description

    * 15.4.2.4. epilog

    * 15.4.2.5. parents

    * 15.4.2.6. formatter_class

    * 15.4.2.7. prefix_chars

    * 15.4.2.8. fromfile_prefix_chars

    * 15.4.2.9. argument_default

    * 15.4.2.10. conflict_handler

    * 15.4.2.11. add_help

  * 15.4.3. La méthode *add_argument()*

    * 15.4.3.1. nom ou option

    * 15.4.3.2. action

    * 15.4.3.3. nargs

    * 15.4.3.4. const

    * 15.4.3.5. default

    * 15.4.3.6. type

    * 15.4.3.7. choices

    * 15.4.3.8. required

    * 15.4.3.9. help

    * 15.4.3.10. metavar

    * 15.4.3.11. dest

    * 15.4.3.12. Classes Action

  * 15.4.4. La méthode *parse_args()*

    * 15.4.4.1. Option value syntax

    * 15.4.4.2. Arguments invalides

    * 15.4.4.3. Arguments contenant "-"

    * 15.4.4.4. Arguments abrégés (Part comparaison de leur
      préfixes)

    * 15.4.4.5. Au delà de "sys.argv"

    * 15.4.4.6. L’objet namespace

  * 15.4.5. Autres outils

    * 15.4.5.1. Sous commandes

    * 15.4.5.2. Objets "FileType"

    * 15.4.5.3. Groupes d’arguments

    * 15.4.5.4. Exclusion mutuelle

    * 15.4.5.5. Valeurs par défaut de l’analyseur

    * 15.4.5.6. Afficher l’aide

    * 15.4.5.7. *Parsing* partiel

    * 15.4.5.8. Personnaliser le *parsing* de fichiers

    * 15.4.5.9. Exiting methods

  * 15.4.6. Mettre à jour du code "optparse"

* 15.5. "optparse" — Parser for command line options

  * 15.5.1. Background

    * 15.5.1.1. Terminology

    * 15.5.1.2. What are options for?

    * 15.5.1.3. What are positional arguments for?

  * 15.5.2. Tutoriel

    * 15.5.2.1. Understanding option actions

    * 15.5.2.2. The store action

    * 15.5.2.3. Handling boolean (flag) options

    * 15.5.2.4. Other actions

    * 15.5.2.5. Valeurs par défaut

    * 15.5.2.6. Generating help

      * 15.5.2.6.1. Grouping Options

    * 15.5.2.7. Printing a version string

    * 15.5.2.8. How "optparse" handles errors

    * 15.5.2.9. Putting it all together

  * 15.5.3. Reference Guide

    * 15.5.3.1. Creating the parser

    * 15.5.3.2. Populating the parser

    * 15.5.3.3. Defining options

    * 15.5.3.4. Option attributes

    * 15.5.3.5. Standard option actions

    * 15.5.3.6. Standard option types

    * 15.5.3.7. Analyse des arguments

    * 15.5.3.8. Querying and manipulating your option parser

    * 15.5.3.9. Conflicts between options

    * 15.5.3.10. Cleanup

    * 15.5.3.11. Other methods

  * 15.5.4. Option Callbacks

    * 15.5.4.1. Defining a callback option

    * 15.5.4.2. How callbacks are called

    * 15.5.4.3. Raising errors in a callback

    * 15.5.4.4. Callback example 1: trivial callback

    * 15.5.4.5. Callback example 2: check option order

    * 15.5.4.6. Callback example 3: check option order (generalized)

    * 15.5.4.7. Callback example 4: check arbitrary condition

    * 15.5.4.8. Callback example 5: fixed arguments

    * 15.5.4.9. Callback example 6: variable arguments

  * 15.5.5. Extending "optparse"

    * 15.5.5.1. Adding new types

    * 15.5.5.2. Adding new actions

* 15.6. "getopt" — C-style parser for command line options

* 15.7. "logging" — Logging facility for Python

  * 15.7.1. Logger Objects

  * 15.7.2. Logging Levels

  * 15.7.3. Handler Objects

  * 15.7.4. Formatter Objects

  * 15.7.5. Filter Objects

  * 15.7.6. LogRecord Objects

  * 15.7.7. LogRecord attributes

  * 15.7.8. LoggerAdapter Objects

  * 15.7.9. Thread Safety

  * 15.7.10. Fonctions de niveau module

  * 15.7.11. Integration with the warnings module

* 15.8. "logging.config" — Logging configuration

  * 15.8.1. Configuration functions

  * 15.8.2. Configuration dictionary schema

    * 15.8.2.1. Dictionary Schema Details

    * 15.8.2.2. Incremental Configuration

    * 15.8.2.3. Object connections

    * 15.8.2.4. User-defined objects

    * 15.8.2.5. Access to external objects

    * 15.8.2.6. Access to internal objects

    * 15.8.2.7. Import resolution and custom importers

  * 15.8.3. Configuration file format

* 15.9. "logging.handlers" — Logging handlers

  * 15.9.1. StreamHandler

  * 15.9.2. FileHandler

  * 15.9.3. NullHandler

  * 15.9.4. WatchedFileHandler

  * 15.9.5. RotatingFileHandler

  * 15.9.6. TimedRotatingFileHandler

  * 15.9.7. SocketHandler

  * 15.9.8. DatagramHandler

  * 15.9.9. SysLogHandler

  * 15.9.10. NTEventLogHandler

  * 15.9.11. SMTPHandler

  * 15.9.12. MemoryHandler

  * 15.9.13. HTTPHandler

* 15.10. Saisie de mot de passe portable

* 15.11. "curses" — Terminal handling for character-cell displays

  * 15.11.1. Fonctions

  * 15.11.2. Window Objects

  * 15.11.3. Constantes

* 15.12. "curses.textpad" — Text input widget for curses programs

  * 15.12.1. Textbox objects

* 15.13. "curses.ascii" — Utilities for ASCII characters

* 15.14. "curses.panel" — A panel stack extension for curses

  * 15.14.1. Fonctions

  * 15.14.2. Panel Objects

* 15.15. "platform" —  Access to underlying platform’s identifying
  data

  * 15.15.1. Cross Platform

  * 15.15.2. Java Platform

  * 15.15.3. Windows Platform

    * 15.15.3.1. Win95/98 specific

  * 15.15.4. Mac OS Platform

  * 15.15.5. Unix Platforms

* 15.16. "errno" — Standard errno system symbols

* 15.17. "ctypes" — A foreign function library for Python

  * 15.17.1. ctypes tutorial

    * 15.17.1.1. Loading dynamic link libraries

    * 15.17.1.2. Accessing functions from loaded dlls

    * 15.17.1.3. Calling functions

    * 15.17.1.4. Fundamental data types

    * 15.17.1.5. Calling functions, continued

    * 15.17.1.6. Calling functions with your own custom data types

    * 15.17.1.7. Specifying the required argument types (function
      prototypes)

    * 15.17.1.8. Return types

    * 15.17.1.9. Passing pointers (or: passing parameters by
      reference)

    * 15.17.1.10. Structures and unions

    * 15.17.1.11. Structure/union alignment and byte order

    * 15.17.1.12. Bit fields in structures and unions

    * 15.17.1.13. Arrays

    * 15.17.1.14. Pointers

    * 15.17.1.15. Type conversions

    * 15.17.1.16. Incomplete Types

    * 15.17.1.17. Callback functions

    * 15.17.1.18. Accessing values exported from dlls

    * 15.17.1.19. Surprises

    * 15.17.1.20. Variable-sized data types

  * 15.17.2. ctypes reference

    * 15.17.2.1. Finding shared libraries

    * 15.17.2.2. Loading shared libraries

    * 15.17.2.3. Foreign functions

    * 15.17.2.4. Function prototypes

    * 15.17.2.5. Utility functions

    * 15.17.2.6. Types de données

    * 15.17.2.7. Fundamental data types

    * 15.17.2.8. Structured data types

    * 15.17.2.9. Arrays and pointers
