在python脚本内运行linux命令
#/usr/bin/env python import subprocess class RunCmd(object): def cmd_run(self, cmd): self.cmd = cmd subprocess.call(self.cmd, shell=True) #Sample usage a = RunCmd() a.cmd_run('ls -l')
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/8275.html