python subprocess popen 静默模式(不弹出console控制台)

python subprocess popen 静默模式(不弹出console控制台)

import subprocess,sys
 
IS_WIN32 = 'win32' in str(sys.platform).lower()
 
if IS_WIN32:
    startupinfo = subprocess.STARTUPINFO()
    startupinfo.dwFlags = subprocess.CREATE_NEW_CONSOLE | 
    subprocess.STARTF_USESHOWWINDOW
    startupinfo.wShowWindow = subprocess.SW_HIDE
    p = subprocess.popen([],startupinfo = startupinfo)

 

参考链接:https://blog.csdn.net/ztb3214/article/details/19256849?utm_source=blogxgwz9

posted @ 2019-05-30 17:55  ibingshan  阅读(3495)  评论(0编辑  收藏  举报