Emulating a Windows shortcut in Python
This is probably a fairly simple question, but I have gone thoroughly overwhelmed trying to figure it out.
I want to start another program in Windows from Python 2.6. I have the "comm开发者_StackOverflow社区and-line argument" figured out so that if I create shortcut and double-click on it the other program opens, does what it needs to, and then closes.
I started with the subprocess library, but that seemed not to work. I got overwhelmed looking at all of the different versions of "popen"
How do I run in an external program from Python like I had double-clicked on a shortcut?
Something like below maybe?
import os
os.system("notepad")
Or:
from subprocess import call
call(["notepad"])
The below question has some excellent answers:
Calling an external command in Python
精彩评论