文件和目录访问¶
本章中描述的模块处理磁盘文件和目录。 例如,有一些模块用于读取文件的属性,以可移植的方式操作路径以及创建临时文件。 本章的完整模块列表如下:
pathlib--- 面向对象的文件系统路径os.path--- 常见路径操作fileinput--- Iterate over lines from multiple input streamsstat--- Interpretingstat()resultsfilecmp--- 文件及目录的比较tempfile--- Generate temporary files and directoriesglob--- Unix style pathname pattern expansionfnmatch--- Unix filename pattern matchinglinecache--- Random access to text linesshutil--- High-level file operationsmacpath--- Mac OS 9 路径操作函数
