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
p = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE) | |
# Grab stdout line by line as it becomes available. This will loop until | |
# p terminates. | |
while p.poll() is None: | |
l = p.stdout.readline() # This blocks until it receives a newline. | |
print l | |
# When the subprocess terminates there might be unconsumed output | |
# that still needs to be processed. | |
print p.stdout.read() |
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
import logging.config | |
import coloredlogs | |
logging.config.dictConfig( | |
{ | |
"version": 1, | |
"disable_existing_loggers": False, | |
"formatters": { | |
"verbose": { |
OlderNewer