命令执行

import subprocess
res=subprocess.Popen('dir',shell=True,stdout= subprocess.PIPE)     #执行命令dir,将结果交给管道
res.stdout.read()            #读取管道内容
posted on 2018-10-23 21:13  cherrydot  阅读(91)  评论(0编辑  收藏  举报