Files, Paths and the Operating System
pathlib, os, sys, shutil, glob, fnmatch, tempfile, filecmp, stat and io.
This is an overview — pick a sub-topic below.
Sub-topics (8)
pathlib
Object-oriented file paths that work on every operating system.
os
Operating-system interfaces: environment variables, processes, directories and low-level files.
sys
Interpreter information: argv, path, exit, stdin/stdout, version and platform.
shutil
High-level file operations: copy, move, delete trees, archives and disk usage.
glob and fnmatch
Find files by wildcard patterns (*.py, data_??.csv, **/*.json).
tempfile
Create temporary files and directories that are cleaned up automatically.
filecmp and stat
Compare files and directories, and interpret file-mode bits.
io
The I/O stack: text and binary streams, plus in-memory StringIO and BytesIO.
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.