liveBook · Manning

Shutil

shutil is a Python standard-library module providing high-level operations for copying, moving, archiving, and managing files and directories.

How 2 Manning books explain it

Learn AI-Assisted Python Programming, Second Edition

shutil is a Python standard-library module that provides high-level operations for copying, moving, archiving, and managing files and directories.

How it is used
Automates copying files into a combined directory while preserving originals and excluding duplicate pictures.
How deep it goes
Descends from importing shutil to implementing nested merge functions, but defers broader file-management operations.
Examples
Uses pictures1, pictures2, pictures_combined, PNG files, and a make_copy function as concrete artifacts.
What you can do after
Build it from scratch by writing a tested duplicate-free file-copying tool with Python’s built-in modules.

Read how Learn AI-Assisted Python Programming, Second Edition explains shutil →

The Quick Python Book, Fourth Edition

shutil is a Python standard-library module providing high-level operations on files and collections of files.

How it is used
Handles moving files and copying or removing directory trees during filesystem tasks.
How deep it goes
Explains the principal tree operations and demonstrates a file move, but defers detailed API usage to standard-library documentation.
Examples
Demonstrates a backup script that totals non-symlink `.test` files and moves them with shutil.move.
What you can do after
Apply it via shutil.move, shutil.copytree, or shutil.rmtree to move files, copy directory trees, or remove nonempty trees.

Read how The Quick Python Book, Fourth Edition explains shutil →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.