转自:http://blog.csdn.net/laiahu/article/details/6697930
python中执行linux命令:
os.system(cmd)
如果要把返回信息置入变量中:
textlist = os.popen(cmd)
例:
cmd = 'ps -ef '
textlist = os.popen(cmd).readlines()
for line in textlist:
......
更多:https://blog.csdn.net/shanliangliuxing/article/details/8811701