Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- def progress_bar(percent, bar_length=50):
- hashes = '#' * int(percent / 100 * bar_length)
- spaces = ' ' * (bar_length - len(hashes))
- print(f'\r{hashes} {spaces} {percent}% ', end='')
- time.sleep(0.02)
- def main():
- print("Hello World")
- for i in range(101):
- progress_bar(i)
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment