Mercurial > hg > config
changeset 125:a51df2382390
new program that does silly things
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Fri, 04 Mar 2011 11:43:15 -0800 |
parents | 2f0baf81372f |
children | 6d2e986c0dae |
files | python/accentuate.py |
diffstat | 1 files changed, 23 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/accentuate.py Fri Mar 04 11:43:15 2011 -0800 @@ -0,0 +1,23 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import random + +mapping = {'a': ['Ȁ', 'ȁ'], + 'c': ['ç'], + 'e': ['ȅ'], + 'n': ['И'], + 'o': ['ổ', 'ȍ'], + 't': ['Ṱ'], + } + +if __name__ == '__main__': + import sys + arg = ' '.join(sys.argv[1:]) + retval = [] + for letter in arg: + if letter.lower() in mapping: + retval.append(random.sample(mapping[letter.lower()], 1)[0]) + else: + retval.append(letter) + print ''.join(retval)