Created
August 5, 2016 19:47
-
-
Save brizandrew/a98d15266b40f3d066e8de02a6d69795 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
""" | |
@type dict | |
A dictionary containing data for the spinning line character output | |
@property {str} count: The amount of time, the spinner has spun | |
@property {List} chars: The list of characters to cycle through in order to simulate spinning | |
@constant | |
""" | |
spinner = {'count':0,'chars':['|','/','-','\\']} | |
""" | |
@function spinSpinner | |
Rotates the spinner displayed on the screen by 30 degrees | |
""" | |
def spinSpinner(): | |
sys.stdout.write('\b') | |
sys.stdout.write(spinner['chars'][spinner['count']%4]) | |
spinner['count'] += 1 | |
sys.stdout.flush() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment