Как принудительно запустить приложение (например, «Блокнот») с помощью модуля «подпроцесс» Python в MS Windows?
Среда: Windows XP, Python 2.5.4
Я попробовал следующее.
## Notepad is invoked in front
>>> import subprocess
>>> command = r'notepad C:\tmp\foo.txt'
>>> subprocess.Popen(command) # opened in front
## Notepad is invoked but not in front
>>> import subprocess, time
>>> command = r'notepad C:\tmp\foo.txt'
>>> time.sleep(5) # click other application while sleeping
>>> subprocess.Popen(command) # opened but not in front!
Я хочу, чтобы окно блокнота было впереди принудительно
даже если выбрано другое приложение.