subprocess弹出窗口去除
最近在用subprocess调用命令行的时候经常会遇到弹出黑框的问题,很令人讨厌。现记录下用去除黑框的方法:
import subprocess st=subprocess.STARTUPINFO st.dwFlags=subprocess.STARTF_USESHOWWINDOW st.wShowWindow=subprocess.SW_HIDE s=subprocess.Popen("sc query mysql",startupinfo=st)
最近在用subprocess调用命令行的时候经常会遇到弹出黑框的问题,很令人讨厌。现记录下用去除黑框的方法:
import subprocess st=subprocess.STARTUPINFO st.dwFlags=subprocess.STARTF_USESHOWWINDOW st.wShowWindow=subprocess.SW_HIDE s=subprocess.Popen("sc query mysql",startupinfo=st)