shutil — High-level file operations — Python 3.16.0a0 documentation

docs.python.org

Tin mới

linecache — Random access to text lines

Python Module Index

3.16.0a0 Documentation

The Python Standard Library

File and Directory Access

os: Miscellaneous operating system interfaces.

The shutil module offers a number of high-level operations on files and collections of files. In particular, functions are provided which support file copying and removal. For operations on individual files, see also the

Platform-dependent efficient copy operations¶

Starting from Python 3.8, all functions involving a file copy (copyfile(), copy(), copy2(), copytree(), and move()) may use platform-specific “fast-copy” syscalls in order to copy the file more efficiently (see bpo-33671

zipfile: Read and write ZIP-format archive files.

Changed in version 3.5: Added support for the xztar format.

tarfile: Read and write tar-format archive files.

Changed in version 3.5: Added support for the xztar format.

zlib: Low-level interface to compression and decompression routines compatible with gzip.

Create an archive file (such as zip or tar) and return its name.

bz2: Interfaces for bzip2 compression and decompression.

Create an archive file (such as zip or tar) and return its name.

lzma: A Python wrapper for the liblzma compression library.

Create an archive file (such as zip or tar) and return its name.

compression.zstd: Low-level interface to compression and decompression routines in the zstd library.

Create an archive file (such as zip or tar) and return its name.