Skip to content

Instantly share code, notes, and snippets.

@richo
Created October 24, 2018 23:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richo/fcbd5f57c8c1c9123e005b3697a94885 to your computer and use it in GitHub Desktop.
Save richo/fcbd5f57c8c1c9123e005b3697a94885 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import string
replacements = {
'!': ':exclamation:',
'?': ':question:',
'0': ':zero:',
'1': ':one:',
'2': ':two:',
'3': ':three:',
'4': ':four:',
'5': ':five:',
'6': ':six:',
'7': ':seven:',
'8': ':eight:',
'9': ':nine:',
'™': ':tm:',
}
def embiggen_word(word):
def inner(_word):
for i in word.lower():
if i in string.ascii_lowercase:
yield ":big-%s:" % i
else:
yield replacements.get(i, i)
return ''.join(inner(word))
sys.stdout.write(":sparkles:%s:end_sparkles:" % (' '.join(map(embiggen_word, sys.argv[1:]))))
sys.stdout.flush()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment