Created
April 28, 2013 12:51
-
-
Save ddasilva/5476801 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
Usage: figdemo <message> | |
Example: figdemo "what's up github" | |
""" | |
import commands | |
import sys | |
def main(): | |
figlist_out = commands.getoutput('figlist') | |
figlist_lines = figlist_out.splitlines() | |
start_idx = figlist_lines.index('Figlet fonts in this directory:') + 1 | |
end_idx = figlist_lines.index('Figlet control files in this directory:') | |
fonts = figlist_lines[start_idx:end_idx] | |
message = ' '.join(sys.argv[1:]) | |
for font in fonts: | |
print '%s:' % font | |
print commands.getoutput('figlet -f %s "%s"' % (font, message)) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment