#NEWLINE# def run( command , spit_output = False ) : #NEWLINE# #INDENT# encoding = locale . getpreferredencoding ( ) #NEWLINE# p = Popen ( encoding , shell = True , stdout = PIPE , stderr = PIPE ) #NEWLINE# ( out , err ) = p . communicate ( ) #NEWLINE# if spit_output : #NEWLINE# #INDENT# print ( '\nTHIS WAS THE OUTPUT:\n{}\n=======' . format ( out . decode ( encoding ) ) ) #NEWLINE# print ( '\nTHIS WAS THE ERR:\n{}\n=======' . format ( err . decode ( encoding ) ) ) #NEWLINE# #UNINDENT# return ( out . decode ( encoding ) , err . decode ( encoding ) )