Skip to content

Instantly share code, notes, and snippets.

@jongyeol
Created April 18, 2011 17:13
Show Gist options
  • Save jongyeol/925728 to your computer and use it in GitHub Desktop.
Save jongyeol/925728 to your computer and use it in GitHub Desktop.
Vertical Banner
#!/usr/bin/env python
# vbanner.py (vertical banner) - coded by jong10
# https://gist.github.com/925728
# problem: http://club.filltong.net/codingdojo/28903
# only for Mac OS X -_-;;
import subprocess
def vbanner(s, width):
horizontal = subprocess.check_output(['banner', '-w', str(width), s])
vertical = zip(*(line + (' ' * (width - len(line))) for line in horizontal.split('\n')))
return '\n'.join(''.join(c) for c in reversed(vertical))
if __name__ == '__main__':
print vbanner('coding dojo', 40)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment