rsalmei / alive-progress

A new kind of Progress Bar, with real-time throughput, ETA, and very cool animations!
MIT License
5.45k stars 205 forks source link

Jupyter environment #270

Closed brunolnetto closed 6 months ago

brunolnetto commented 6 months ago

How to make this great tool work on jupyter notebook cells?

rsalmei commented 6 months ago

It should work already. Is it not working for you?

brunolnetto commented 6 months ago

I tried to apply on a future.concurrent application without much of a success. Is the library suitable for such cases?

Take for instance the code below on jupyter notebook. It only displays the last bar frame.

from alive_progress import alive_bar
from time import sleep

n = 1000
with alive_bar() as bar:
    for i in range(n):
        bar()
        sleep(0.01)  # Pause for 0.1 seconds
TheTechRobo commented 6 months ago

Try adding force_tty=True to the alive_bar() function call: https://github.com/rsalmei/alive-progress?tab=readme-ov-file#forcing-animations-on-pycharm-jupyter-etc