Python Module shutil: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 7: Line 7:
=Overview=
=Overview=
The <code>shutil</code> module offers 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 <code>[[Python Module os|os]]</code> module.
The <code>shutil</code> module offers 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 <code>[[Python Module os|os]]</code> module.
=Recursively Copy a Directory=


=Organizatorium=
=Organizatorium=

Revision as of 20:17, 2 March 2022

External

Internal

Overview

The shutil module offers 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 os module.

Recursively Copy a Directory

Organizatorium

from shutil import which
for i in m:
  print("{:20}{:7}".format(m[i], "OK" if which(i) else "missing"))