Skip to content

Instantly share code, notes, and snippets.

@bossiernesto
Created March 8, 2017 17:46
Show Gist options
  • Select an option

  • Save bossiernesto/96ac6faf0860c03c11f911bbbc374575 to your computer and use it in GitHub Desktop.

Select an option

Save bossiernesto/96ac6faf0860c03c11f911bbbc374575 to your computer and use it in GitHub Desktop.
import sys
import time
import itertools
def spinning_cursor():
while True:
for cursor in '|/-\\':
yield cursor
#spinner = spinning_cursor()
spinner = itertools.cycle(['-','/','|','\\'])
for _ in range(50):
sys.stdout.write(next(spinner))
sys.stdout.flush()
time.sleep(0.1)
sys.stdout.write('\b')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment