作者环境为python3 GetHardwareInfo.py #!/usr/bin/python # -*- coding: UTF-8 -*- import psutil import os #infomation of Hardware, include disk, CPU, RAM class HardwareInfo(object): def __init__(self): self.disk_total = 0 self.disk_used = 0 self.disk_free = 0 self.disk_percent = 0 self.ram_total = 0 self.ram_us