You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a test python program using the enlighten progress bar module that will generate 10 progress bars in threads, with random counters. They will load and run independently but attached to a manager. Once the counters complete, they are removed. The issue is that it leaves a blank line. Is there any way to remove that behavior?
If rand is 3, then range(rand) would yield 0, 1, and 2. With range(rand + 1), you would also get 3 and that would exceed the total for the counter.
for num in range(20):
time.sleep(1) # Simulate work
print('Counters are running. Interval is {}'.format(num))
Can probably be better expressed as
start = time.time()
while any(thread.is_alive() for thread in global_threads):
time.sleep(1) # Simulate work
print(f'Counters are running: {time.time() - start:.2f} seconds.')
Not required, but more flexible
counter.close()
If you want to blank the line, change this to
counter.close(clear=True)
As far as removing the blank or completed lines, Enlighten currently only does that when adding new counters, since that's when the positions get calculated, but I can definitely see wanting to do it as the threads finish. I can add that when I get a chance.
I created a test python program using the enlighten progress bar module that will generate 10 progress bars in threads, with random counters. They will load and run independently but attached to a manager. Once the counters complete, they are removed. The issue is that it leaves a blank line. Is there any way to remove that behavior?
The text was updated successfully, but these errors were encountered: