IdentifiantMot de passe
Mot de passe oublié ?Je m'inscris ! (gratuit)
11. File and Directory Access

11. File and Directory Access

The modules described in this chapter deal with disk files and directories. For example, there are modules for reading the properties of files, manipulating paths in a portable way, and creating temporary files. The full list of modules in this chapter is:

os.path   Common pathname manipulations.
fileinput   Perl-like iteration over lines from multiple input streams, with ``save in place'' capability.
stat   Utilities for interpreting the results of os.stat(), os.lstat() and os.fstat().
statvfs   Constants for interpreting the result of os.statvfs().
filecmp   Compare files efficiently.
tempfile   Generate temporary files and directories.
glob   Unix shell style pathname pattern expansion.
fnmatch   Unix shell style filename pattern matching.
linecache   This module provides random access to individual lines from text files.
shutil   High-level file operations, including copying.
dircache   Return directory listing, with cache mechanism.

Also see section 3.9 for a description of Python's built-in file objects.

See Also:

Module os:
Operating system interfaces, including functions to work with files at a lower level than the built-in file object.
See About this document... for information on suggesting changes.