Skip to content

Commit 9aa45be

Browse files
author
aoberrender
committed
2 parents d7af852 + 92d2e3d commit 9aa45be

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

testing/randomstuff.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import itertools
2+
import sys
3+
import time
4+
5+
def loading_spinner():
6+
spinner = itertools.cycle(['-', '/', '|', '\\'])
7+
for _ in range(20):
8+
sys.stdout.write(next(spinner)) # write the next character
9+
sys.stdout.flush() # flush the output
10+
time.sleep(0.1)
11+
print("\b", end='') # erase the last character
12+
13+
loading_spinner()

0 commit comments

Comments
 (0)