Guest User

Untitled

a guest
Oct 21st, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. def progressBar(value, endvalue, bar_length=41):
  2. percent = float(value) / endvalue
  3. arrow = '-' * int(round(percent * bar_length)-1) + '>'
  4. spaces = ' ' * (bar_length - len(arrow))
  5.  
  6. sys.stdout.write("\rPercent: [{0}] {1}%".format(arrow + spaces, int(round(percent * 100))))
  7. sys.stdout.flush()
Add Comment
Please, Sign In to add comment