zai centos下怎样安装openwebmail
1个回答
展开全部
Popen
#!/usr/bin/env python
#coding=utf-8
from subprocess import Popen, PIPE
import re
def disk_space(pattern="2[0-9]%", message="CAPACITY WARNING"):
## take shell command output
ps = Popen("df -h", shell=True, stdout=PIPE, stderr=PIPE)
output_lines = ps.stdout.readlines()
for line in output_lines:
line = line.strip()
if re.search(pattern, line):
print "%s %s" %(message, line)
if __name__ == '__main__':
disk_space()
#!/usr/bin/env python
#coding=utf-8
from subprocess import Popen, PIPE
import re
def disk_space(pattern="2[0-9]%", message="CAPACITY WARNING"):
## take shell command output
ps = Popen("df -h", shell=True, stdout=PIPE, stderr=PIPE)
output_lines = ps.stdout.readlines()
for line in output_lines:
line = line.strip()
if re.search(pattern, line):
print "%s %s" %(message, line)
if __name__ == '__main__':
disk_space()
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询