Reputation: 4149
import os
os.system("notepad macros.txt")
or
from subprocess import Popen
Popen(["notepad", "macros.txt"])
both start notepad in the background. How to start it in the foreground?
Upvotes: 5
Views: 5710
Reputation: 80761
You can try to use the start command, maybe the /MAX option will force notepad to be in foreground, otherwise if you can wait untill notepad shutdown, use the /WAIT option/
Popen(["start", "/MAX", "notepad", "macros.txt"], shell=True)
Upvotes: 2