python执行centos命令

import os
improt sys
import re
import commands

a = commands.getoutput("ls -al /")
print a
原文地址:https://www.cnblogs.com/lurenjia1994/p/9674330.html