I had found this topic and i found this as a solution:
Module subprocess has no attribute 'STARTF_USESHOWWINDOW'
but when I run code reality differs. :/
Run my code:
# Get the environment variables from OO-Python using subprocess oo_py_exec = os.path.join(oo_dir, r'program\python.exe') python_oo_script = ' ;'.join([ "-cimport os", "print(os.environ['URE_BOOTSTRAP'])", "print(os.environ['UNO_PATH'])", "print(os.environ['PATH'])", ]) subprocess.STARTF_USESHOWWINDOW info = subprocess.STARTUPINFO() info.dwFlags = subprocess.STARTF_USESHOWWINDOW info.wShowWindow = subprocess.SW_HIDE process = subprocess.Popen([oo_py_exec, python_oo_script], stdout=subprocess.PIPE, startupinfo=info) result = process.communicate()
Console is showed.
Run code from link:
kwargs = {} if subprocess.mswindows: su = subprocess.STARTUPINFO() su.dwFlags |= subprocess.STARTF_USESHOWWINDOW su.wShowWindow = subprocess.SW_HIDE kwargs['startupinfo'] = su subprocess.Popen("cmd.exe", **kwargs)
Console is also showed!
win xp, py 2.6