python显示系统信息脚本

#!/usr/bin/env python
import subprocess

uname = "uname"
uname_arg = "-a"
print "Gathering system information with %s command:\n" % uname
subprocess.call([uname,uname_arg])

diskspace = "df"
diskspace_arg = "-h"
print "Gathering diskspace information %s command:\n" % diskspace
subprocess.call([diskspace,diskspace_arg])
~                                              

 

posted @ 2016-04-17 17:03  知_行  阅读(354)  评论(0编辑  收藏  举报