Skip to content

Instantly share code, notes, and snippets.

@mattdennewitz
Forked from tamask/acronym.py
Created December 14, 2012 18:18
Show Gist options
  • Save mattdennewitz/4287419 to your computer and use it in GitHub Desktop.
Save mattdennewitz/4287419 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys
last = ''
punc = ','
while True:
c = sys.stdin.read(1)
if c:
if c in punc or c.isalpha() and not last.isalpha() and last not in ('\'',):
sys.stdout.write(c.upper())
last = c
else:
sys.stdout.write('\n')
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment