def execute_external_command(command, cmd_input=None):
 result = ''
 P = Popen([command], stdout=PIPE, stdin=PIPE, stderr=PIPE, shell=True)
 (result, err) = P.communicate(cmd_input)
 if (err and (config.Option.get('debug') == 'on')):
  warning_msg(err)
 return decode_string_escape(result)

def execute_external_command ( command , cmd_input = None ) : result = '' P = Popen ( [ command ] , stdout = PIPE , stdin = PIPE , stderr = PIPE , shell = True ) ( result , err ) = P . communicate ( cmd_input ) if ( err and ( config . Option . get ( 'debug' ) == 'on' ) ) : warning_msg ( err ) return decode_string_escape ( result )
execute external command and capture its output args: - command returns: - output of command .