Skip to main content

Little terminal spinner lib.

Project description

Latest Version

A little terminal spinner lib. Heavily inspired by go-spin.

Demo

pyspin\_demo

pyspin_demo

Install

$ pip install pyspin

Usage

from __future__ import print_function, unicode_literals

import sys
import time

from pyspin import spin

# Choose a spin style.
spin = spin.Spinner(spin.Default)
# Spin it now.
for i in range(50):
    print("\r{0}".format(spin.next()), end="")
    sys.stdout.flush()
    time.sleep(0.1)

or you can use the decorator pyspin provide.

from __future__ import print_function, unicode_literals

from pyspin import spin
from pyspin.spin import make_spin

# Choose a spin style and the words when showing the spin.
@make_spin(spin.Default, "say some words here...")
def download_video():
    print("I'm downloading a video, and it'll cost much time.")
    time.sleep(10)
    print("Done!")

You can have a look at the example code in the example folder.

License

MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyspin-0.1.0.tar.gz (3.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page