Skip to content

Instantly share code, notes, and snippets.

@s4553711
Created March 30, 2018 03:25
Show Gist options
  • Save s4553711/80e21e1532fb70bbb9c3757a999bd352 to your computer and use it in GitHub Desktop.
Save s4553711/80e21e1532fb70bbb9c3757a999bd352 to your computer and use it in GitHub Desktop.
import sys
import time
def spinning_cursor():
while True:
for cursor in '|/-\\':
yield cursor
spinner = spinning_cursor()
for _ in range(50):
sys.stdout.write(spinner.next())
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