On this page
  1. shutil.disk_usage
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

shutil.disk_usage

Prev: shutil.copytree | Up: shutil | Next: shutil.Error
Rel: shutil.chown, shutil.copy, shutil.copy2, shutil.copyfile
Ref: docs.python.org — shutil.disk_usage
Tags: #public #python3 #stdlib #shutil


Import

import shutil
from shutil import disk_usage

Signature & Overview

shutil.disk_usage(path)

Return disk usage statistics about the given path.

Usage

import shutil

usage = shutil.disk_usage(".")
assert usage.total >= usage.used and usage.free >= 0

Gotchas

REPL Inspect

from shutil import disk_usage
help(disk_usage)

Linked from

Related notes