Skip to content

Instantly share code, notes, and snippets.

@morishin
Last active November 3, 2016 05:35
Show Gist options
  • Save morishin/9f1ec091714457f0e253 to your computer and use it in GitHub Desktop.
Save morishin/9f1ec091714457f0e253 to your computer and use it in GitHub Desktop.
from __future__ import print_function
import sys
def spinner_gen():
while 1:
yield '|'
yield '/'
yield '-'
yield '\\'
if __name__ == '__main__':
for spinner in spinner_gen():
print(spinner + '\033[1D', end='', file=sys.stderr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment