Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Python
Posted by: Cammy And
Added: May 29, 2020 5:09 PM
Views: 29
  1. import itertools
  2. import sys
  3. import time
  4.  
  5. spinner = itertools.cycle(['-', '/', '|', '\\'])
  6. for _ in range(50):
  7.     sys.stdout.write(next(spinner))
  8.     sys.stdout.flush()
  9.     time.sleep(0.1)
  10.     sys.stdout.write('\b')