python获取linux系统信息的三种方法
方法一:psutil模块 #!usr/bin/env python # -*- coding: utf-8 -*- import socket import psutil class NodeResource(object): def get_host_info(self): host_name = socket.gethostname() return {'host_name':host_name} def get_cpu_state(self): cpu_count = psutil.cpu_count(logical=False) cpu_percent =(str
用户评论