Text under progress bar
See original GitHub issueWouldn’t it be nice if while the progress bar is running, right under it you had one line of text which gets updated with a custom message after each bar() call. Lets call this a “progress text bar”
For example:
with alive_bar(total, progressTextBarTitle='Inserted in DB:') as bar:
for item from data:
# do some processing
bar( progressText=item.text() )
Then you would get something like this: |██████████████ | 4130/5532 [67%] in 43.4s (127.43/s) [ Inserted in DB: license plate ZYZ-999 ]
… and it would be continuously updated just like the progress bar…
|██████████████ | 4131/5532 [68%] in 43.4s (127.43/s) [ Inserted in DB: license plate ABC-123 ]
… and so son.
So you pass the title for the progress text bar when declaring the alive_bar(), and for each bar() call, you pass it the text that will be displayed in the progress text bar, which is a continuously updated text bar right under the progress bar.
While the progress bar is running, right under it you get quickly updating texts explaining what it is doing. In this example, I would be updating a database, inserting items into it, with the progress text bar listing the titles of the elements I’m inserting into the database.
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (10 by maintainers)
Top GitHub Comments
Hey @mmigliari, it’s published!! 2.4.0 brings this feature, I called it Dual Line Text Mode!
I’m glad you liked it. I’ll try to get back to it this weekend and release it.
You’re welcome!