import logging import subprocess logger = logging.getLogger(__name__) def run(args, capture_output = False, **kwargs): logger.debug('Executing: ' + ' '.join(args)) if capture_output: return subprocess.check_output(args, **kwargs).decode() subprocess.check_call(args, **kwargs)