Python 获取磁盘信息的脚本

来源:互联网 发布:office2016激活软件 编辑:程序博客网 时间:2024/05/23 10:54
#!/usr/bin/env pythonimport subprocess#Command 1def uname_func():    uname="uname"    uname_arg="-a"    print "Gathering system information with %s command:\n" % uname    subprocess.call([uname,uname_arg])#command 2def disk_func():    diskspace = "df"    diskspace_arg="-h"    print "Gathering diskspace information %s command:\n" % diskspace    subprocess.call([diskspace,diskspace_arg])def main():    uname_func()    disk_func()main()
0 0
原创粉丝点击