def executeCmd(cmd):
command=['cmd.exe', '/c'] + cmd.split()
res = subprocess.check_output(command, stderr=subprocess.STDOUT, stdin=subprocess.PIPE, universal_newlines=True)
# info=subprocess.STARTUPINFO()
# info.dwFlags=subprocess.STARTF_USESHOWWINDOW | subprocess.CREATE_NEW_PROCESS_GROUP
# info.wShowWindow=subprocess.SW_HIDE
# p=subprocess.Popen(command, startupinfo=info, stderr=subprocess.STDOUT, stdout=subprocess.PIPE, universal_newlines=True)
# results, _=p.communicate()
return res
评论列表
文章目录