Skip to content
Discussion options

You must be logged in to vote

I managed to figure something out that is good enough for me. It's not multiple lines of output, just a single line.

Code:

            # progress bar for terminal output (will be hidden when step is done)
            # disabling markup because it causes live to hang
            prog = Progress(TextColumn("{task.description}", markup=False))
            task_id = prog.add_task(" ".join(cmd))

            # Use Live to update progress with output
            with Live(prog, console=console, transient=True) as live:
                with open(file, 'wb') as o: # the file here is to log the full output
                    with subprocess.Popen(cmd, stdout=subprocess.PIPE) as proc:
            …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by zachwhaley
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant