commands有三个主要函数,可以使用help(commands)查看,是python的内置模块

1.commands.getstatusoutput(cmd)返回一个元组tuple(status, output),status为int类型,result为string类型。

status代表的shell命令的返回状态,如果成功的话是0;output是shell的返回的结果

2.commands.getstatus(file)

3.commands.getoutput(cmd)  判断Shell命令的输出内容 (返回结果为string类型)

相关文章:

  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
猜你喜欢
  • 2021-11-05
  • 2021-06-15
  • 2021-11-15
  • 2022-12-23
  • 2021-08-04
  • 2022-02-03
  • 2022-12-23
相关资源
相似解决方案