(prog, output=True)
inititalize an application
       PROG is the full command with args
       OUTPUT true if output should be returned
       false if output should be dumped to null.  This will
       return a process handle and is meant for initializing
       background processes.  Use wisely.
inititalize an application
       PROG is the full command with args
       OUTPUT true if output should be returned
       false if output should be dumped to null.  This will
       return a process handle and is meant for initializing
       background processes.  Use wisely.
inititalize an application PROG is the full command with args OUTPUT true if output should be returned false if output should be dumped to null . This will return a process handle and is meant for initializing background processes . Use wisely .
def init_app(prog, output=True):
    """inititalize an application
       PROG is the full command with args
       OUTPUT true if output should be returned
       false if output should be dumped to null.  This will
       return a process handle and is meant for initializing
       background processes.  Use wisely.
    """
    # dump output to null
    if not output:
        try:
            null = open(os.devnull, 'w')
            proc = Popen(prog, stdout=null, stderr=null)
        except Exception, j:
            Error("Error initializing app: %s" % j)
            return False
        return proc
    # just grab output
    else:
        return getoutput(prog)
def init_app ( prog , output = True ) : # dump output to null if not output : try : null = open ( os . devnull , 'w' ) proc = Popen ( prog , stdout = null , stderr = null ) except Exception , j : Error ( "Error initializing app: %s" % j ) return False return proc # just grab output else : return getoutput ( prog )