investigator.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:cpu-g 作者: atareao 项目源码 文件源码
def disksinfo(self):
        values = []
        disk_partitions = psutil.disk_partitions(all=False)
        for partition in disk_partitions:
            usage = psutil.disk_usage(partition.mountpoint)
            device = {'device': partition.device,
                      'mountpoint': partition.mountpoint,
                      'fstype': partition.fstype,
                      'opts': partition.opts,
                      'total': usage.total,
                      'used': usage.used,
                      'free': usage.free,
                      'percent': usage.percent
                      }
            values.append(device)
        values = sorted(values, key=lambda device: device['device'])
        return values
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号