import commands,os,sys msg = commands.getstatusoutput('ls -l') print msg ~ 转载于:https://www.cnblogs.com/sunkedong/p/7498721.html