Mercurial > hg > config
view python/accentuate.py @ 134:cea81044578e
add a JSON explorer
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Fri, 25 Mar 2011 09:58:29 -0700 |
parents | 6d2e986c0dae |
children | a612a16f11a7 |
line wrap: on
line source
#!/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)