问题描述:

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.
相关阅读:
Top