python磁盘使用
pdu的Python项目详细描述
python磁盘使用情况
以路径作为参数并递归返回其磁盘总使用量。
安装
pip install pdu
cli用法
usage: pdu [-h] [path]
Python Disk Usage Calculator.
positional arguments:
path A valid path.
optional arguments:
-h, --help show this help message and exit
python用法
path='/path/to/some/file/or/directory'frompduimportduhuman_readable_size=du(path)frompduimportcalcsize_in_bytes=calc(path)frompduimportconverthuman_readable_units=convert(bytes)