Tqdm: Separate colors for complete and in progress bars

Created on 20 Nov 2019  Â·  4Comments  Â·  Source: tqdm/tqdm

Is it possible to see have different colors for completed bars and bars in progress if I use PyCharm (e.g. green for completed and red for in progress)? Right now all I see is red for everything. Below is an example of how I currently do it in PyCharm.

from tqdm import tqdm
from time import sleep

for _ in tqdm(range(0, 5), desc="Bar 1"):
    sleep(0.5)

for _ in tqdm(range(0, 5), desc="Bar 2"):
    sleep(1)
invalid â›” p2-bug-warning âš 

Most helpful comment

PyCharm always colours stderr red. There are hacks around this: https://stackoverflow.com/questions/20333674/pycharm-logging-output-colours

For example, tqdm(..., file=sys.stdout).

All 4 comments

Hi, @casperdcl , I saw the text color of tqdm is red in PyCharm.
So, can I set it into default color as the normal terminal output?

PyCharm always colours stderr red. There are hacks around this: https://stackoverflow.com/questions/20333674/pycharm-logging-output-colours

For example, tqdm(..., file=sys.stdout).

@casperdcl , thanks sincerely for you help!

related (coming soon): #1040; haven't tested in PyCharm though.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andreasbaumann picture andreasbaumann  Â·  5Comments

CrazyPython picture CrazyPython  Â·  5Comments

techkang picture techkang  Â·  4Comments

AliAbdelaal picture AliAbdelaal  Â·  4Comments

Haffi112 picture Haffi112  Â·  5Comments