def get_status_text_output(cmd):
""" Run the cmd, return the output as a list of lines
as well as the stat of the cmd (True or False), content
of the out will be decoded.
"""
stat, output = subprocess.getstatusoutput(cmd)
if stat == 0:
output = output.split('\n') if output else []
res = (True, output)
else:
res = (False, [])
return res
评论列表
文章目录