rsalmei / alive-progress

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

Usage with np.arange() #266

Closed zooplibob closed 3 weeks ago

zooplibob commented 8 months ago

I have some code doing a sweep using np.arrange:

for variable in np.arange(10, 20, 0.1): ...

I can use manual mode can calculate the percentage, but how can I have it display the actual value of variable next to the bar (rather than just percent)?

TheTechRobo commented 8 months ago

Check out the Displaying messages section of the README - bar.text might be what you're looking for

rsalmei commented 8 months ago

You have two ways. One is like you and @TheTechRobo have said: use manual mode to directly calculate the percentage, and bar.text to display it on the bar. Another is to just use the variable range as the total, which would automatically calculate the percentage for you. You could also show it the same way.

range = (20 - 10) / .1 = 100 steps