repl.it
@StanleyBlack/

waiting dots

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import sys
import time

loading = True  
loading_speed = 4 
loading_string = "." * 6  
while loading:
    for index, char in enumerate(loading_string):
        sys.stdout.write(char)  
        sys.stdout.flush()  
        time.sleep(3 / loading_speed) 
    index += 1  
    sys.stdout.write("\b" * index + " " * index + "\b" * index)
    sys.stdout.flush()  
    break
print("hi")