Created
January 15, 2019 18:45
-
-
Save olivx/d4abafc5eb9137a0db4cbbe3482ead05 to your computer and use it in GitHub Desktop.
create a login on console
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
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: | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment