I want to open a process in the background and interact with it, but this process should be invisible in both Linux and Windows. In Windows you have to do some stuff with S
You can turn your code into:
params = dict() if os.name == 'nt': startupinfo = subprocess.STARTUPINFO() startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW params['startupinfo'] = startupinfo proc = subprocess.Popen(command, **params)
but that's not much better.