0

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 "command-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?

Jacob
  • 3
  • 1

1 Answers1

1

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

Community
  • 1
  • 1
manojlds
  • 290,304
  • 63
  • 469
  • 417
  • Thank you so much for the help! It seems to be something wrong with the argument I'm calling on my external program… Although it works fine as a shortcut, and returns immediately without doing anything as a argument to os.system. Shrug, Well Thanks for the help. – Jacob May 15 '11 at 14:49