import time
import subprocess

print "Opening TweetDeck...\n"
while a>=0:
    print (str(a)+" seconds remaining...")
    a-=5"C:\Program Files\TweetDeck\TweetDeck.exe")

#Rest period
print ("\nWaiting...")

print "\nOpening Mozilla Firefox...\n"
while a>=0:
    print (str(a)+" seconds remaining...")
    a-=5"C:\Program Files\Mozilla Firefox\firefox.exe")

Hey guys,

I used the above code to open programs(TweetDeck and Firefox).
What I want to do is, make it read a text file, where I can list all the program I want to open. And I know how to do this, but;
how do I run the program at startup(any other way than dragging and dropping it in the Start menu>Startup?).

The problem is: after TweetDeck opens, FF doesn't open until I close TweetDeck? Any ideas why?


When you call an executable from the command line, it waits until it closes (finishes executing) to move on. For example if you had a batch file like this:


It would open Firefox, and then if you closed Firefox it would open Internet Explorer.

I'm not sure of an exact way to get around this but the general answer is that you have to dive a little deeper into the subprocess module, which is not super fun. Also, you might want to take a look at batch file behavior, and figure out how to start a program and then move on.

Sounds like it should. I'm DEFINETLY the wrong person to ask about threading though, maybe somebody else could chime in...