Tqdm progressbar and colorama do not work together

I want to use colorama, but I already use tqdm in my code.

Example:

import colorama as color
import tqdm as tqdm  # without line it working
print(color.Fore.GREEN + 'Green text')

It works fine without tqdm, but if I import tqdm, colorama does not color the text until I restart the console. I am using the IPython console with Spyder (Python 3.6).

Can I use these packages together?

+4
source share
1 answer

try to do this ( https://github.com/tqdm/tqdm/issues/450 )

from tqdm import trange
from colorama import Fore
for i in trange(int(7e7),
    bar_format="{l_bar}%s{bar}%s{r_bar}" % (Fore.GREEN, Fore.RESET)):
    pass
0
source

Source: https://habr.com/ru/post/1673518/


All Articles