Skip to content
UPEEC

Files, Paths and the Operating System

pathlib, os, sys, shutil, glob, fnmatch, tempfile, filecmp, stat and io.

Beginner
Comments 0

This is an overview — pick a sub-topic below.

Sub-topics (8)

pathlib

Object-oriented file paths that work on every operating system.

Beginner♥ 0🔖 0💬 0

os

Operating-system interfaces: environment variables, processes, directories and low-level files.

Easy♥ 0🔖 0💬 0

sys

Interpreter information: argv, path, exit, stdin/stdout, version and platform.

Easy♥ 0🔖 0💬 0

shutil

High-level file operations: copy, move, delete trees, archives and disk usage.

Beginner♥ 0🔖 0💬 0

glob and fnmatch

Find files by wildcard patterns (*.py, data_??.csv, **/*.json).

Beginner♥ 0🔖 0💬 0

tempfile

Create temporary files and directories that are cleaned up automatically.

Easy♥ 0🔖 0💬 0

filecmp and stat

Compare files and directories, and interpret file-mode bits.

Intermediate♥ 0🔖 0💬 0

io

The I/O stack: text and binary streams, plus in-memory StringIO and BytesIO.

Easy♥ 0🔖 0💬 0

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.