rsalmei / alive-progress

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

How to disable show when print #261

Closed chasingboy closed 8 months ago

chasingboy commented 8 months ago

Hello,this is my code and running result. How can I do not display content like on 1, on 2,... in front of every line.

>>> from alive_progress import alive_bar
>>> with alive_bar(100) as bar:
...     for line in range(0,100):
...         print(line)
...         bar()
... 
on 0: 0
on 1: 1
on 2: 2
on 3: 3
on 4: 4
... ...
on 97: 97
on 98: 98
on 99: 99
|████████████████████████████████████████| 100/100 [100%] in 0.0s (12755.15/s) 

I want to display it like that.


>>> from alive_progress import alive_bar
>>> with alive_bar(100) as bar:
...     for line in range(0,100):
...         print(line)
...         bar()
... 
 0
 1
2
3
4
...
98
99
|████████████████████████████████████████| 100/100 [100%] in 0.0s (12755.15/s) 
``
Thanks!!!
TheTechRobo commented 8 months ago

Try using alive_bar(100, enrich_print=False)?

rsalmei commented 8 months ago

Hello, Exactly as @TheTechRobo has said. Please read the config docs, this one and several others are explained there. Sure thing 👍

chasingboy commented 8 months ago

@TheTechRobo @rsalmei Thanks! alive_bar(100, enrich_print=False) is useful.