from halo import Halo with Halo(text='Processing...', spinner='dots') as spinner: # Some long-running task for i in range(100000): pass spinner.succeed('Done!')
from halo import Halo # Define the custom frames frames = ['[= ]', '[ = ]', '[ = ]', '[ =]', '[ = ]', '[ = ]'] with Halo(text='Custom Animation', animation='frames', frames=frames) as spinner: # Some long-running task for i in range(100000): pass spinner.succeed('Done!')In this example, a custom animation is created by defining a list of frames that will be cycled through. The animation is displayed while a long-running task is executed, and when the task is completed, the spinner is updated with a success message. Halo is part of the Python Package Index (PyPI) library and can be installed using pip.