def execute_command(self, command, args=[]):
        """ Execute a command

        Parameters:

        command - The command to execute
        args    - Command arguments, as a list
        """

        execfn = [command] + list(args)

        try:
            p = Popen(execfn, env=os.environ)
            p.wait()
            return p.returncode
        except Exception,e:
            print e
        
        return -1
 Execute a command

        Parameters:

        command - The command to execute
        args    - Command arguments, as a list
        
recipes/Python/498137_Minicommands_using_subprocess/recipe-498137.py