You can reduce one line 🙂
startupinfo = None
if os.name == 'nt':
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
proc = subprocess.Popen(command, startupinfo=startupinfo)
More Related Contents:
- Python: how to kill child process(es) when parent dies?
- Python multiprocessing linux windows difference
- Sub-process in Python execute two task? [closed]
- How do you run a Python script as a service in Windows?
- ImageMagick not authorized to convert PDF to an image
- How do I hide the console when I use os.system() or subprocess.call()?
- Python spawn off a child subprocess, detach, and exit
- Shebang Notation: Python Scripts on Windows and Linux?
- How to find the real user home directory using python?
- Run Process and Don’t Wait
- subprocess: deleting child processes in Windows
- Packaging a Python script on Linux into a Windows executable
- How do I get all of the output from my .exe using subprocess and Popen?
- How to kill a python child process created with subprocess.check_output() when the parent dies?
- What’s the best way to duplicate fork() in windows?
- Python virtualenv questions
- Cross-platform space remaining on volume using python
- How to get output from subprocess.Popen(). proc.stdout.readline() blocks, no data prints out
- ‘yes’ reporting error with subprocess communicate()
- Understanding python subprocess.check_output’s first argument and shell=True [duplicate]
- Can Python select what network adapter when opening a socket?
- Sending a password over SSH or SCP with subprocess.Popen
- ‘^’ is ignored by Python – how to escape ‘^’ character in Popen Windows?
- How to use “/” (directory separator) in both Linux and Windows in Python?
- Run multiple programs sequentially in one Windows command prompt?
- Python subprocess.Popen as different user on Windows
- Launch IPython notebook with selected browser
- Sending ^C to Python subprocess objects on Windows
- Execute Commands Sequentially in Python?
- How to install and import Python modules at runtime