Skip to main content

Colourz adds coloured text output and spinners to a Windows shell (Powershell / CMD)

Project description

colourz

Colourz adds coloured text output and spinners to a Windows shell (Powershell / CMD)

Installation

$ pipenv install colourz

Usage

import colourz

# Print in bold text
print(colourz.bold("Bold text"))

# Print text in red
print(colourz.normal("Red text", "RED"))

# Print text in bold red
print(colourz.bold("Bold red text", "RED"))

# Use Bullets when waiting on a long task
import time

def main():
    s = colourz.Bullets()
    print("Doing long task...")
    s.start()
    long_task()
    s.stop()
    print("Success!")

# CAUTION: As Bullets is threaded, we need to watch out for exceptions
def long_task():
    raise LongTaskError

def main():
    s = colourz.Bullets()
    print("Doing long task...")
    s.start()
    try:
        long_task()
        msg = "Success!"
    except LongTaskError:
        msg = "Fail!"
    finally:
        s.stop()
        print(msg)

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

colourz-1.0.4.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

colourz-1.0.4-py2.py3-none-any.whl (3.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file colourz-1.0.4.tar.gz.

File metadata

  • Download URL: colourz-1.0.4.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for colourz-1.0.4.tar.gz
Algorithm Hash digest
SHA256 9e84baaef8435fedb627fc6d52063e0e1d7e1b6c17ed9077c63be6c43d67d4f6
MD5 cd9789c2bd63e639f6dee975d03099d6
BLAKE2b-256 f8ceb2208681cd292cc158bde5572d4f905288227b64e9aafd585b881753586a

See more details on using hashes here.

File details

Details for the file colourz-1.0.4-py2.py3-none-any.whl.

File metadata

  • Download URL: colourz-1.0.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for colourz-1.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6e3c40188ccb72a3a01c0745ec85eff141b6a623e7270de09ed286e138af8bbc
MD5 c08d728ec5a54a451191e1e56639a2b8
BLAKE2b-256 df5a7b3842f674b01730f22cf7559c249d03f8bcc4954e19733b8f45397e04f2

See more details on using hashes here.

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