Last active
February 23, 2019 17:12
-
-
Save Alquimista/d6947134587b3b392af9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def run_command(command): | |
process = subprocess.Popen(shlex.split(command), stdout=subprocess.PIPE) | |
while True: | |
output = process.stdout.readline() | |
if output == '' and process.poll() is not None: | |
break | |
if output: | |
self.logger.info(output.strip()) | |
rc = process.poll() | |
return rc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment