ces 慢慢 hat .get spl 主机名 start serve /etc/
- . os = " ".join(platform.linux_distribution())
- . os = subprocess.call(['cat', '/etc/redhat-release'])
- import socket
- hostname = socket.gethostname()
- . os.cpu_count()
- . psutil.cpu_count()
Python 获取系统信息(慢慢补充)
- with open('/proc/cpuinfo') as f:
- for line in f:
- if line.startswith('model name'):
- server_cpu = line.split(":")[1].strip()
来源: http://www.bubuko.com/infodetail-2450663.html