#๐Ÿ”’ Coloring incorrect results in TQDM as red like as bad sectors on disks.

19 messages ยท Page 1 of 1 (latest)

bright night
#

I am trying to inherit TQDM class and make it so it colors results that "if not result", mark it as red.
any ideas? I don't really know how to inherit classes.

late beaconBOT
#

@bright night

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

full scarab
#

you need a proof of concept of what you want to do

bright night
#

An example?

full scarab
#

so using tqdm as it is now, what should be considdered an error?

#

and why

bright night
#

"if not result", my wording isn't very nice ik

#

I could make it an optional feature, like tqdm(mark_errors=False) (default to False)

full scarab
#

then you dont need to make anything, just iterate over your data and do the writing to the screen manually

#
from tqdm.auto import tqdm, trange
from time import sleep

bar = trange(10)
for i in bar:
    # Print using tqdm class method .write()
    sleep(0.1)
    if not (i % 3):
        tqdm.write("Done task %i" % i)
    # Can also use bar.write()

bright night
#

but that doesn't affect the bar's color?

#

I mean something like this

#

where red are incorrect results and green are the correct

#

nevermind, I thought why it's not possible, at least, not possible and visually correct

#

I think we can close the help page

bright night
#

!close

late beaconBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.