python中的popen和subprocess

import os
from subprocess import Popen, PIPE

res = os.popen('xx.exe E:\\test\\file1 E:\\test\\file2')
print res.read()

ps = Popen("xx.exe E:\\test\\file1 E:\\test\\file2", shell = True, stdout = PIPE, stderr = PIPE)
res = ps.stdout.read()
print res

 

posted @ 2015-12-29 15:44  LarryKnight  阅读(358)  评论(0编辑  收藏  举报