commands模块用于调用shell命令

有3中方法:

commands.getstatus()   返回执行状态

commands.getoutput()   返回执行结果

commands.getstatusoutput()  返回一个元组,执行状态和执行结果

 

其他执行shell命令的方法还有:

1.os.system(cmd)

2.os.popen(cmd)

 

相关文章:

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