#NEWLINE# def execute( command , cwd = None ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# st = subprocess . PIPE #NEWLINE# proc = subprocess . Popen ( args = command , stdout = st , stderr = st , stdin = st , cwd = cwd ) #NEWLINE# ( output , error ) = proc . communicate ( ) #NEWLINE# code = proc . returncode #NEWLINE# return ( st , output , error ) #NEWLINE# #UNINDENT# except OSError as error : #NEWLINE# #INDENT# return ( ( - 1 ) , '' , error )