Skip to content
Discussion options

You must be logged in to vote

Hi,

By default the progress bar in rich will be shown under the text being printed.

Here is a very simple code sample that will do what you want:

import time
from rich.progress import track
sample_text = [
    "Text may be printed while the progress bars are rendering.",
    "This is pretty neat.",
    "I do not have a lot of things to say.",
    "So I will stop here."
]
for example in track(sample_text, total=len(sample_text)):
    time.sleep(1)
    print(example)

rich also has a more advance example you can run:

python -m rich.progress

This is a more feature rich solution that you can look at here (😜pun intended).

Here is the quick rundown:

  • line 977 to 1006: The data being printed is g…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@willmcgugan
Comment options

@garlontas
Comment options

@saschalalala
Comment options

@garlontas
Comment options

Answer selected by garlontas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants