A little terminal spinner lib. Heavily inspired by go-spin.
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.
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 details)
File details
Details for the file pyspin-0.1.0.tar.gz.
File metadata
- Download URL: pyspin-0.1.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
189bbf6d0c386558f78b9ea6b7e3dea63000f8b2d414b5d53d787124fdbf5d29
|
|
| MD5 |
2ae20e0d420229e92e771f95ebbf2104
|
|
| BLAKE2b-256 |
67859720a7bbef47618136933265b3b38fcc849bad20546e4b7aefaa8d50cc47
|