Search
⌨️

Getting disk usage in Python

import shutil total, used, free = shutil.disk_usage("/") print("Total: %d GiB" % (total // (2**30))) print("Used: %d GiB" % (used // (2**30))) print("Free: %d GiB" % (free // (2**30)))
Shell
복사