Skip to main content
`Ctrl`+`K`

# Spinner

class astropy.utils.console.Spinner(msg, color='default', file=None, step=1, chars=None)

  Bases: `object`

  A class to display a spinner in the terminal.

  It is designed to be used with the `with` statement:

      with Spinner("Reticulating splines", "green") as s:
          for item in enumerate(items):
              s.update()

  Parameters:
    msg `python:str`

      The message to print

    color `python:str`, optional

      An ANSI terminal color name. Must be one of: black, red, green, brown, blue, magenta, cyan, lightgrey, default, darkgrey, lightred, lightgreen, yellow, lightblue, lightmagenta, lightcyan, white.

    file file-like (writeable), optional

      The file to write the spinner to. Defaults to `sys.stdout`. If `file` is not a tty (as determined by calling its `isatty` member, if any, or special case hacks to detect the IPython console), the spinner will be completely silent.

    step `python:int`, optional

      Only update the spinner every step steps

    chars `python:str`, optional

      The character sequence to use for the spinner

  Methods Summary

  `update`([value]) | Update the spin wheel in the terminal.

  Methods Documentation

  update(value=None)

    Update the spin wheel in the terminal.

    Parameters:
      value `python:int`, optional

        Ignored (present just for compatibility with `ProgressBar.update`).