python - How to easily print ascii-art text? -
i have program dumps lot of output, , i want of output stand out. 1 way render important text ascii art, this web service example:
 #    #   ##   #####  #    # # #    #  ####    #    #  #  #  #    # ##   # # ##   # #    #   #    # #    # #    # # #  # # # #  # #        # ## # ###### #####  #  # # # #  # # #  ###   ##  ## #    # #   #  #   ## # #   ## #    #   #    # #    # #    # #    # # #    #  ####   other solutions colored or bold output. how sort of stuff in python?
- pyfiglet - pure python implementation of http://www.figlet.org - pip install pyfiglet
- termcolor - helper functions ansi color formatting - pip install termcolor
- colorama - multiplatform support (windows) - pip install colorama
import sys  colorama import init init(strip=not sys.stdout.isatty()) # strip colors if stdout redirected termcolor import cprint  pyfiglet import figlet_format  cprint(figlet_format('missile!', font='starwars'),        'yellow', 'on_red', attrs=['bold']) example
$ python print-warning.py  
$ python print-warning.py | cat .___ ___. __ _______. _______. __ __ _______ __ | \/ | | | / | / || | | | | ____|| | | \ / | | | | (----` | (----`| | | | | |__ | | | |\/| | | | \ \ \ \ | | | | | __| | | | | | | | | .----) | .----) | | | | `----.| |____ |__| |__| |__| |__| |_______/ |_______/ |__| |_______||_______|(__)
Comments
Post a Comment