shutil

The standard library module for high-level file operations such as copying, moving and deleting whole folders.

In more detail

shutil.copy copies a file, shutil.copytree a whole folder and shutil.rmtree deletes a folder with everything in it, so use that last one carefully. For single files and paths, pathlib usually reads better.

Related terms

Taught in

References

Certification courses