码迷,mamicode.com
首页 > 编程语言 > 详细

跨平台的系统信息获取python库 - psutil

时间:2015-03-01 22:27:26      阅读:286      评论:0      收藏:0      [点我收藏+]

标签:python psutil os linux cpu memory network disks information

想写一个REST API来获取OS的CPU,内存等系统信息,正准备苦哈哈的轮一个 /proc/stat 的parser,发现了psutil ~ 一个跨平台的获取系统信息的python库,支持linux,windows,osx,sunos, 可以说很好,很全面,很pythonic


https://github.com/giampaolo/psutil


简介:

psutil (python system and process utilities) is a cross-platform library for retrieving information on running processes and system utilization(CPU, memory, disks, network) in Python. It is useful mainly for system monitoring, profiling and limiting process resources and management of running processes. It implements many functionalities offered by command line tools such as: ps, top, lsof, netstat, ifconfig, who, df, kill, free, nice, ionice, iostat, iotop, uptime, pidof, tty, taskset, pmap. It currently supportsLinux, Windows, OSX, FreeBSD and Sun Solaris, both 32-bit and64-bit architectures, with Python versions from 2.6 to 3.4 (users of Python 2.4 and 2.5 may use 2.1.3 version).PyPy is also known to work.


跨平台的系统信息获取python库 - psutil

标签:python psutil os linux cpu memory network disks information

原文地址:http://shinn1982.blog.51cto.com/9930914/1616305

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!