Skip to content

Instantly share code, notes, and snippets.

@ddasilva
Created April 28, 2013 12:51
Show Gist options
  • Save ddasilva/5476801 to your computer and use it in GitHub Desktop.
Save ddasilva/5476801 to your computer and use it in GitHub Desktop.
#!/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