This file contains hidden or 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
# this function allows outputting the subprocess output to the console without blocking the execution of the program by | |
# assigning the printing function to a thread | |
def run_command(self, command): | |
p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | |
def readstdout(): | |
for line in p.stdout: | |
print(line.strip()) |