3

The clint progress bar is based on an iterator.
urllib.urlretrieve() has a callback that reports the completion of a chunk downloading.
Can I set the iterator to be in a certain position everytime the callback is called?

the_drow
  • 18,571
  • 25
  • 126
  • 193

1 Answers1

1

Looking at the source, i see that it only goes up. To start at a specific value, use:

for i in progress.dots(range(your_start_value)): pass

To backspace, try:

sys.stderr.write(' \b\b' * amount); sys.stderr.flush()

That probably won't work without using the colorama module's locate feature, in which case you'd be better off simply writing ("=" * percent_done + " " * percent_left).

Cees Timmerman
  • 17,623
  • 11
  • 91
  • 124