Skip to content

Instantly share code, notes, and snippets.

@ctrlaltdev
Created October 8, 2020 21:32
Show Gist options
  • Save ctrlaltdev/d51bf16956fb6a96e14cbe65cd937271 to your computer and use it in GitHub Desktop.
Save ctrlaltdev/d51bf16956fb6a96e14cbe65cd937271 to your computer and use it in GitHub Desktop.
import time
import math
def loader(index=0, total=100):
max = 25
tty = math.floor(index * max / total)
bar = ('#' * tty) + ('_' * (max - tty))
print('[{}] - {}/{}'.format(bar, index, total), end = '\n' if index == total else '\r')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment