Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colored Progress Bars #450

Closed
rafpyprog opened this issue Sep 28, 2017 · 4 comments · Fixed by #1040 or #1041
Closed

Colored Progress Bars #450

rafpyprog opened this issue Sep 28, 2017 · 4 comments · Fixed by #1040 or #1041
Assignees
Labels
p3-enhancement 🔥 Much new such feature submodule-notebook 📓 Much web such IDE to-merge ↰ Imminent
Projects
Milestone

Comments

@rafpyprog
Copy link

rafpyprog commented Sep 28, 2017

With a few tweaks in the code I managed to add a color argument to tqdm.

newgif1

Is this already an implemented feature ? Anyone likes it ?

@rafpyprog rafpyprog changed the title Colered Progress Bars Colored Progress Bars Sep 28, 2017
@casperdcl casperdcl reopened this Sep 28, 2017
@casperdcl
Copy link
Sponsor Member

casperdcl commented Sep 28, 2017

colours seem a bit distracting. If you do want them:

from tqdm import trange
from colorama import Fore


for i in trange(int(7e7),
                bar_format="{l_bar}%s{bar}%s{r_bar}" % (Fore.BLUE, Fore.RESET)):
    pass

@Ehsan1997
Copy link

Ehsan1997 commented Sep 26, 2020

Both above mentioned methods are not working with notebook, any idea why?

@casperdcl
Copy link
Sponsor Member

notebooks (tqdm.notebook.tqdm) are different. They don't appear to support colour

https://ipywidgets.readthedocs.io/en/latest/examples/Widget%20List.html#IntProgress

@casperdcl
Copy link
Sponsor Member

casperdcl commented Sep 27, 2020

Right... should be possible: jupyter-widgets/ipywidgets#2982 (comment)

from tqdm.notebook import tqdm, trange

with trange(int(1e7)) as pbar:
    pbar.container.children[-2].style.bar_color = '#ffff00'  # or 'yellow'
    for i in pbar:
        pass

TODO: make this easier

@casperdcl casperdcl reopened this Sep 27, 2020
@casperdcl casperdcl self-assigned this Sep 27, 2020
@casperdcl casperdcl added p3-enhancement 🔥 Much new such feature submodule-notebook 📓 Much web such IDE to-merge ↰ Imminent labels Sep 27, 2020
@casperdcl casperdcl added this to the Non-breaking milestone Sep 27, 2020
@casperdcl casperdcl added this to Next Release in Casper Sep 27, 2020
casperdcl added a commit that referenced this issue Sep 27, 2020
casperdcl added a commit that referenced this issue Sep 27, 2020
casperdcl added a commit that referenced this issue Sep 27, 2020
casperdcl added a commit that referenced this issue Sep 27, 2020
casperdcl added a commit that referenced this issue Sep 27, 2020
casperdcl added a commit that referenced this issue Sep 27, 2020
Casper automation moved this from Next Release to Done Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3-enhancement 🔥 Much new such feature submodule-notebook 📓 Much web such IDE to-merge ↰ Imminent
Projects
Casper
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants