def execute(self):
        """Execute a system command."""
        if self._decode_output:
            # Capture and decode system output
            with Popen(self.command, shell=True, stdout=PIPE) as process:
                self._output = [i.decode("utf-8").strip() for i in process.stdout]
                self._success = True
        else:
            # Execute without capturing output
            os.system(self.command)
            self._success = True
        return self
def execute ( self ) : if self . _decode_output : with Popen ( self . command , shell = True , stdout = PIPE ) as process : self . _output = [ i . decode ( "utf-8" ) . strip ( ) for i in process . stdout ] self . _success = True else : os . system ( self . command ) self . _success = True return self
Execute a system command.