To start several applications I'd recommend to use threading.
shellcommands=("notepad.exe", "calc.exe", "mspaint.exe") import os import sys import time import datetime import threading import subprocess class ThreadClass(threading.Thread): # Override Thread's __init__ method to accept the parameters needed: def __init__ ( self, command ): self.command = command threading.Thread.__init__ ( self ) def run(self): now = datetime.datetime.now() print "%s %s %s \n" % (self.getName(), self.command,now) try: subprocess.call(self.command, shell=True) except Exception, err: print "ERROR: %s\n" % str(err) for cmd in shellcommands: t = ThreadClass(cmd) t.start() sys.exit()
subprocessfor this?subprocessmakes this much easier unless you need to share data between the processes in which case you would usemultiprocessing