Last active
October 30, 2016 16:48
-
-
Save whoo/2a04764d2351ca7631dfdd1daf34c3c6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cols=shutil.get_terminal_size((80, 20)).columns | |
MAX=cols-15 | |
def pbar(cur,size): | |
elmt=int(cur/size*MAX) | |
print("\033[?25l",end="") | |
print("\033[0G[",end="") | |
print("#"*elmt,end="") | |
print("."*(MAX-elmt),end="") | |
print("] %d"%cur,end="") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment