How to bring an application (e.g. Notepad) forward forcefully with the Python subprocess module in MS Windows?
Environment: Windows XP, Python 2.5.4
I tried the following.
>>> import subprocess
>>> command = r'notepad C:\tmp\foo.txt'
>>> subprocess.Popen(command)
>>> import subprocess, time
>>> command = r'notepad C:\tmp\foo.txt'
>>> time.sleep(5)
>>> subprocess.Popen(command)
I want the notepad window to be forced even if another application is selected.
source
share