view python/accentuate.py @ 125:a51df2382390

new program that does silly things
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 04 Mar 2011 11:43:15 -0800
parents
children 6d2e986c0dae
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)