def runGetOutput(cmd, raiseOnFailure=False, encoding=sys.getdefaultencoding()):
        '''
            runGetOutput - Simply runs a command and returns the output as a string. Use #runGetResults if you need something more complex.

            @param cmd <str/list> - String of command and arguments, or list of command and arguments

                If cmd is a string, the command will be executed as if ran exactly as written in a shell. This mode supports shell-isms like '&&' and '|'
                If cmd is a list, the first element will be the executable, and further elements are arguments that will be passed to that executable.


            @param raiseOnFailure <True/False> - Default False, if True a non-zero return from the command (failure) will raise a SimpleCommandFailure, which contains all gathered output and return code. @see #SimpleCommandFailure

            
            @param encoding <None/str> - Default sys.getdefaultencoding(), the program's output will automatically be decoded using the provided codec (e.x. "utf-8" or "ascii").

                If None or False-ish, data will not be decoded (i.e. in python3 will be "bytes" type)

                If unsure, leave this as it's default value, or provide "utf-8"


            @return <str> - String of data output by the executed program. This combines stdout and stderr into one string. If you need them separate, use #runGetResults

            @raises SimpleCommandFailure - 

                * If command cannot be executed (like program not found, insufficient permissions, etc)

                * If #raiseOnFailure is set to True, and the program returns non-zero

        '''


        
        results = Simple.runGetResults(cmd, stdout=True, stderr=subprocess.STDOUT, encoding=encoding)
        if raiseOnFailure is True and results['returnCode'] != 0:
            try:
                if issubclass(cmd.__class__, (list, tuple)):
                    cmdStr = ' '.join(cmd)
                else:
                    cmdStr = cmd
            except:
                cmdStr = repr(cmd)
                
            failMsg = "Command '%s' failed with returnCode=%d" %(cmdStr, results['returnCode'])
            raise SimpleCommandFailure(failMsg, results['returnCode'], results.get('stdout', None), results.get('stderr', None))
            

        return results['stdout']
def runGetOutput ( cmd , raiseOnFailure = False , encoding = sys . getdefaultencoding ( ) ) : results = Simple . runGetResults ( cmd , stdout = True , stderr = subprocess . STDOUT , encoding = encoding ) if raiseOnFailure is True and results [ 'returnCode' ] != 0 : try : if issubclass ( cmd . __class__ , ( list , tuple ) ) : cmdStr = ' ' . join ( cmd ) else : cmdStr = cmd except : cmdStr = repr ( cmd ) failMsg = "Command '%s' failed with returnCode=%d" % ( cmdStr , results [ 'returnCode' ] ) raise SimpleCommandFailure ( failMsg , results [ 'returnCode' ] , results . get ( 'stdout' , None ) , results . get ( 'stderr' , None ) ) return results [ 'stdout' ]
runGetOutput - Simply runs a command and returns the output as a string. Use #runGetResults if you need something more complex.

            @param cmd <str/list> - String of command and arguments, or list of command and arguments

                If cmd is a string, the command will be executed as if ran exactly as written in a shell. This mode supports shell-isms like '&&' and '|'
                If cmd is a list, the first element will be the executable, and further elements are arguments that will be passed to that executable.


            @param raiseOnFailure <True/False> - Default False, if True a non-zero return from the command (failure) will raise a SimpleCommandFailure, which contains all gathered output and return code. @see #SimpleCommandFailure

            
            @param encoding <None/str> - Default sys.getdefaultencoding(), the program's output will automatically be decoded using the provided codec (e.x. "utf-8" or "ascii").

                If None or False-ish, data will not be decoded (i.e. in python3 will be "bytes" type)

                If unsure, leave this as it's default value, or provide "utf-8"


            @return <str> - String of data output by the executed program. This combines stdout and stderr into one string. If you need them separate, use #runGetResults

            @raises SimpleCommandFailure - 

                * If command cannot be executed (like program not found, insufficient permissions, etc)

                * If #raiseOnFailure is set to True, and the program returns non-zero