python commands模块

来源:互联网 发布:淘宝视频制作软件 编辑:程序博客网 时间:2024/05/29 13:37

1、commands.getstatusoutput('shell command')  #执行shell命令,返回执行状态和执行结果

可以根据返回状态判断命令是否执行成功,0为真,非0为假

0 0