I have a program that dumps a lot of output, and I want some of that output to really stand out. One way could be to render important text with ascii art, like this web service does for example:
# # ## ##### # # # # # ####
# # # # # # ## # # ## # # #
# # # # # # # # # # # # # #
# ## # ###### ##### # # # # # # # # ###
## ## # # # # # ## # # ## # #
# # # # # # # # # # # ####
other solutions could be colored or bold output. So how to do this sort of stuff easily in Python?
PIL gives a cool way to do this very simple. You can render the text onto a b/w image and convert that bitmap to a string stream replacing the black and white pixels to chars.
It renders the next result:
I made a little more comprehensive example with functional style.
This is fun. I've figured out how to use PIL (the "Pillow" fork, of course) and Numpy to do this fully "vectorized", i.e. without loops:
pyfiglet - pure Python implementation of http://www.figlet.org
termcolor - helper functions for ANSI color formatting
colorama - multiplatform support (Windows)
Example