PrettyOutput allows you to print pretty colors with ease. What more do you want?
Installation
Options:
- Clone this repository (you probably know what you're doing)
- Download the archive from releases
Usage
from utils import prettyoutput
prettyoutput.info(string='Well, isn\'t this neat?')
prettyoutput.success(string='Yes! Yes it is.')
prettyoutput.error(string='Oh noes!')
prettyoutput.warning(string='Get outta here!')
custom_message = prettyoutput.custom(string='Oh noes!', color_code='cyan', stat_msg='[MSG]', prn_out=False)
print(custom_message)
Notice how we created a custom message and stored the value to a variable? PrettyOutput allows you to circumvent implicitely printing your message so that you can do it yourself when you're ready.
PrettyOutput also supports printing without args!
import prettyoutput
prettyoutput.info()
prettyoutput.success()
prettyoutput.error()
prettyoutput.warning()
Notice when executed, everything is aligned perfectly!
Got the time? We do!
Here's how to use the time option. All times are UTC.
import prettyoutput
prettyoutput.error(time=True)
[ERROR] | An error has occured!(2017-04-03 00:46:02)
Python interpreter acting funny?
You're probably seeing a really confusing string of characters, right?
>>> import prettyoutput
>>> prettyoutput.error()
[ERROR] | An error has occured!
'\x1b[0;31;40m[ERROR] | \x1b[1;37;40mAn error has occured!'
>>>
Not to worry!
Try this;
>>> import prettyoutput
>>> print(prettyoutput.error(prn_out=False))
[ERROR] | An error has occured!```
PrettyOutput returns the message created so that it may be re-used. Save the returned string to a variable, and you may never have to call PrettyOutput again!