view python/accentuate.py @ 135:206a6f3144b2

make the menu key show the menu
author Jeff Hammel <jhammel@mozilla.com>
date Sat, 26 Mar 2011 11:58:07 -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)