Print in colour, with no extra charge!
Project description
colourz
Print in colour, with no extra charge!
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.3.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for colourz-1.0.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2a31bf89e1cca65ee28c4b00e7915b204653f5d7ef47c20d443510fbbfb5ad3 |
|
MD5 | 0232a727afb11b47f716bd135c349cab |
|
BLAKE2b-256 | 0eaf54d44b8c2b1183b23dc47475885523a8557a454a1595619fa60474fe07fd |