Python Module shutil: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 14: Line 14:
shutil.copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2, ignore_dangling_symlinks=False, dirs_exist_ok=False)
shutil.copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2, ignore_dangling_symlinks=False, dirs_exist_ok=False)
</syntaxhighlight>
</syntaxhighlight>
==Arguments==
====<tt>ignore</tt>====


=Organizatorium=
=Organizatorium=

Revision as of 20:25, 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

import shutil

shutil.copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2, ignore_dangling_symlinks=False, dirs_exist_ok=False)

Arguments

ignore

Organizatorium

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