Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
from subprocess import Popen, PIPE
import json
def run_command(command):
command_process = Popen(command, stdout=PIPE, shell=True)
while True:
line = command_process.stdout.readline().rstrip()
if not line:
yield line
for line in run_command('tail -f file.log'):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.