9.10. Related Modules
There are plenty of other modules related to files and input/output, all of which work on most of the major platforms. Table9.7 lists some of the file-related modules.
Module(s) | Contents |
---|---|
fileinput | iterates over lines of multiple input text files |
getopt | provides command-line argument parsing/manipulation |
glob/fnmatch | provides Unix-style wildcard character matching |
gzip/zlib/zipfile[a] | allows file access to include automatic de/compression |
shutil | offers high-level file access functionality |
c/StringIO | implements file-like interface on top of string objects |
tempfile | generates temporary file names or files |
[a] new in Python 1.6
The fileinput module iterates over a set of input files and reads their contents one ...
Get Core Python Programming now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.