shutil
Stdlib — OS/FilePython 2.0+Beginner
High-level file operations: copy, move, remove trees, archives
Quick Info
- Documentation
- Official Docs
- Python Version
- 2.0+
- Dependencies
- None — Python Standard Library
- Install
Included with Python
Learn by Difficulty
Quick Example
python
# shutil - high-level file operations import shutil print("shutil provides high-level file operations:") print(" shutil.copy(src, dst)") print(" shutil.copytree(src, dst)") print(" shutil.rmtree(path)") print(" shutil.move(src, dst)")
The shutil module is part of Python's standard library. High-level file operations: copy, move, remove trees, archives.
Try in PlaygroundTags
stdlibfile-iocopymovearchive
Related Items
os
Stdlib — OS/File
Interface to the OS: env vars, process management, file operations
pathlib
Stdlib — OS/File
Object-oriented filesystem paths (modern replacement for os.path)
glob
Stdlib — OS/File
Unix-style pathname pattern expansion (wildcards like *.txt)
zipfile
Stdlib — Compression
Read and write ZIP archives
tarfile
Stdlib — Compression
Read and write tar archives (.tar.gz, .tar.bz2)
tempfile
Stdlib — OS/File
Create temporary files and directories that auto-clean up