def subprocess_Popen(command, **params):
 startupinfo = None
 if (os.name == 'nt'):
  startupinfo = subprocess.STARTUPINFO()
  try:
   startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
  except AttributeError:
   startupinfo.dwFlags |= subprocess._subprocess.STARTF_USESHOWWINDOW
  params['shell'] = True
  if isinstance(command, list):
   command = ' '.join(command)
 stdin = None
 if ('stdin' not in params):
  stdin = open(os.devnull)
  params['stdin'] = stdin.fileno()
 try:
  proc = subprocess.Popen(command, startupinfo=startupinfo, **params)
 finally:
  if (stdin is not None):
   stdin.close()
 return proc

def subprocess_Popen ( command , ** params ) : startupinfo = None if ( os . name == 'nt' ) : startupinfo = subprocess . STARTUPINFO ( ) try : startupinfo . dwFlags |= subprocess . STARTF_USESHOWWINDOW except AttributeError : startupinfo . dwFlags |= subprocess . _subprocess . STARTF_USESHOWWINDOW params [ 'shell' ] = True if isinstance ( command , list ) : command = ' ' . join ( command ) stdin = None if ( 'stdin' not in params ) : stdin = open ( os . devnull ) params [ 'stdin' ] = stdin . fileno ( ) try : proc = subprocess . Popen ( command , startupinfo = startupinfo , ** params ) finally : if ( stdin is not None ) : stdin . close ( ) return proc
utility function to work around windows behavior that open windows .