Skip to content

Instantly share code, notes, and snippets.

@olivx
Created January 15, 2019 18:45
Show Gist options
  • Save olivx/d4abafc5eb9137a0db4cbbe3482ead05 to your computer and use it in GitHub Desktop.
Save olivx/d4abafc5eb9137a0db4cbbe3482ead05 to your computer and use it in GitHub Desktop.
create a login on console
import sys
for index, item in enumerate(range(0,100000000)):
# efeito loading
current = index + 1
filled_length = int(100 * current // total_items)
bar = '*' * filled_length + '-' * (100 - filled_length)
percent = 100 * (current / total_items)
percent = ("{0:." + '1' + "f}").format(100 * (current / float(total_items)))
sys.stdout.write("\r%s |%s| %s%% %s" % ('process', bar, percent, 'complete'))
# some process
sys.stdout.flush()
if current == total_items:
print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment