Skip to content

ASanchz85/spinner_shell_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Terminal Spinner Package

A simple Python package to display a spinner in the center of the terminal screen.

Features

  • Displays a rotating spinner in the center of the terminal regardless the size of the screen.
  • Clears the screen before starting the spinner.
  • Hides the cursor while the spinner is running.
  • Restores the cursor to its original position after completion and clears the screen again.

Installation

You can install the package via pip (to be updated once the package is published to PyPI):

pip install terminal-spinner

How to use

from terminal_spinner import run_spinner

# Run the spinner for X seconds, 5 by default
run_spinner(duration=5)

Example

# example.py

from terminal_spinner import run_spinner

def main():
    print("Starting spinner...")
    run_spinner(duration=3)
    print("Spinner done!")

if __name__ == "__main__":
    main()
python example.py

License

This project is licensed under the MIT License

Links

Releases

Packages

Used by

Contributors

Languages