现在的位置: 首页 > 综合 > 正文

python获取shell命令返回值

2013年11月20日 ⁄ 综合 ⁄ 共 93字 ⁄ 字号 评论关闭

返回shell的输出(不管标准输出或是错误输出)

import commands

line = commands.getstatusoutput(shellcommand)
line = line[1]

抱歉!评论已关闭.