Created
November 19, 2024 07:59
-
-
Save vsergeyev/6fd8c28c114cf825eb2460583b12df29 to your computer and use it in GitHub Desktop.
CLI SPINNER PYTHON
This file contains hidden or 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 | |
spinner = cycle(['|', '/', '-', '\\']) | |
while SOMETHING_IN_PROGRESS: | |
sys.stdout.write(f"\r{' ' * 50}\r") # Clear the line | |
sys.stdout.write(f"{next(spinner)} Status: {status}") | |
sys.stdout.flush() | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment