Skip to content

shutil

High-level file operations

  • Copy files src to file or directory dst
shutil.copy(src, dst)
shutil.copy(src, dst) # try to preserve metadata
  • Move a file or directory src to another location dst and return the dest
shutil.move(src, dst)
  • Disk usage (byte)
total, used, free = shutil.disk_usage(path)