Skip to content

Commit

Permalink
Avoid popping up Command Prompt windows when running subprocesses
Browse files Browse the repository at this point in the history
  • Loading branch information
jameswettenhall committed Feb 24, 2020
1 parent 5a73d80 commit 489c1df
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mydata/subprocesses.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
"""
Defines common settings for subprocesses.
"""
import sys
import subprocess

DEFAULT_STARTUP_INFO = None
DEFAULT_CREATION_FLAGS = 0

if sys.platform.startswith("win"):
import win32process
DEFAULT_STARTUP_INFO = subprocess.STARTUPINFO()
DEFAULT_STARTUP_INFO.dwFlags |= subprocess.STARTF_USESHOWWINDOW
DEFAULT_STARTUP_INFO.wShowWindow = subprocess.SW_HIDE
DEFAULT_CREATION_FLAGS = win32process.CREATE_NO_WINDOW

0 comments on commit 489c1df

Please sign in to comment.