当前位置: 动力学知识库 > 问答 > 编程问答 >

Python Subprocess causing latency with shell

问题描述:

This question already has an answer here:

  • How do I hide the console when I use os.system() or subprocess.call()?

    3 answers

网友答案:

Thanks to the related post from @J.F. Sebastian, I was able to figure out how to eliminate the shell popup. Below is the code I used.

startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW      
shellreturn = subprocess.check_output(["C:\Python34\python", root.wgetdir + "\html2text.py", keyworddir + "\\" + item], startupinfo=startupinfo) #this could be any subprocess.
分享给朋友:
您可能感兴趣的文章:
随机阅读: